summaryrefslogtreecommitdiff
path: root/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt
blob: b510ae909c3c4f2224539e45fd93b8afb85c3d41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
SplFileObject::fgetcsv with alternative delimiter
--FILE--
<?php
$fp = fopen('SplFileObject__fgetcsv5.csv', 'w+');
fputcsv($fp, array(
    'field1',
    'field2',
    'field3',
    5
), ',', '"');
fclose($fp);

$fo = new SplFileObject('SplFileObject__fgetcsv5.csv');
try {
    var_dump($fo->fgetcsv(',', 'invalid'));
} catch (ValueError $e) {
    echo $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php
unlink('SplFileObject__fgetcsv5.csv');
?>
--EXPECT--
SplFileObject::fgetcsv(): Argument #2 ($enclosure) must be a single character