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 bug13332: Excel dump, wrong field count in parsing, bug status Bogus
3
--FILE--
4
<?php
5
// $Id: bug13332.phpt,v 1.1 2008/09/21 21:17:19 dufuz Exp $
6
 
7
require_once 'File/CSV.php';
8
 
9
$file = dirname(__FILE__) . '/bug13332.csv';
10
$conf = array(
11
    'fields' => 5,
12
    'sep'    => ',',
13
    'quote'  => '"',
14
    'header' => 0
15
);
16
 
17
$cvs = array();
18
while (($tmp = File_CSV::read($file, $conf)) !== false) {
19
    $csv[] = $tmp;
20
}
21
 
22
var_dump($csv);
23
?>
24
--EXPECT--
25
array(2) {
26
  [0]=>
27
  array(5) {
28
    [0]=>
29
    string(1) "1"
30
    [1]=>
31
    string(1) "2"
32
    [2]=>
33
    string(6) "Twenty"
34
    [3]=>
35
    string(35) "This is a test of a "quoted" value."
36
    [4]=>
37
    string(15) "There is no cow"
38
  }
39
  [1]=>
40
  array(5) {
41
    [0]=>
42
    string(1) "2"
43
    [1]=>
44
    string(1) "4"
45
    [2]=>
46
    string(5) "Forty"
47
    [3]=>
48
    string(37) "Another "quoted value", with a comma."
49
    [4]=>
50
    string(14) "There is a cow"
51
  }
52
}