Annotation of embedaddon/php/ext/spl/tests/SplFileObject_fputcsv_variation14.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test fputcsv() : usage variations - with enclosure & delimiter of two chars
3: --FILE--
4: <?php
5:
6: /* Testing fputcsv() to write to a file when default enclosure value and delimiter
7: of two chars is provided and file is opened in read only mode */
8:
9: echo "*** Testing fputcsv() : with enclosure & delimiter of two chars and file opened in read mode ***\n";
10:
11: $fo = new SplFileObject(__DIR__ . '/SplFileObject_fputcsv.csv', 'w');
12:
13: var_dump($fo->fputcsv(array('water', 'fruit'), ',,', '""'));
14:
15: unset($fo);
16:
17: echo "Done\n";
18: ?>
19: --CLEAN--
20: <?php
21: $file = __DIR__ . '/SplFileObject_fputcsv.csv';
22: unlink($file);
23: ?>
24: --EXPECTF--
25: *** Testing fputcsv() : with enclosure & delimiter of two chars and file opened in read mode ***
26:
27: Warning: SplFileObject::fputcsv(): enclosure must be a character in %s on line %d
28: bool(false)
29: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>