Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
File_CSV Test Case 030: One row, four fields that are multiline with out a EOL and span couple of lines
3
--FILE--
4
<?php
5
// $Id: 030.phpt,v 1.2 2007/05/11 21:49:01 cipri Exp $
6
/**
7
 * Test for:
8
 * - Varian of test 025 but doesn't have to detect the config
9
 * data gotten from http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm
10
 */
11
 
12
require_once 'File/CSV.php';
13
 
14
$file = dirname(__FILE__) . '/030.csv';
15
$conf = array(
16
    'fields' => 4,
17
    'sep'    => ',',
18
    'quote'  => '"'
19
);
20
 
21
$data = array();
22
while ($res = File_CSV::read($file, $conf)) {
23
    $data[] = $res;
24
}
25
 
26
print "Data:\n";
27
print_r($data);
28
print "\n";
29
?>
30
--EXPECT--
31
Data:
32
Array
33
(
34
    [0] => Array
35
        (
36
            [0] => I'm multiline
37
Field
38
that spans
39
over couple
40
of
41
rather odd
42
sections
43
of the
44
world
45
            [1] => Helgi
46
            [2] => foobar
47
            [3] => And I'm another
48
multiline beast
49
that spans
50
couple of
51
lines
52
in
53
this
54
document
55
        )
56
 
57
)