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 031: One row, four fields that are multiline with out a EOL and span couple of lines
3
--FILE--
4
<?php
5
// $Id: 031.phpt,v 1.2 2007/05/11 21:49:01 cipri Exp $
6
/**
7
 * Test for:
8
 * - Varian of test 026 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__) . '/031.csv';
15
$conf = array(
16
    'fields' => 3,
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] => Conference room 1
37
            [1] => John,
38
Please bring the M. Mathers file for review
39
-J.L.
40
 
41
            [2] => 10/18/2002
42
        )
43
 
44
)