From c4dd7a1a684490673e25aaf4fabec5df138854c4 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Thu, 14 Mar 2013 05:42:27 +0000 Subject: Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2. --- ext/spl/tests/SplFileObject_fputcsv_error.phpt | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 ext/spl/tests/SplFileObject_fputcsv_error.phpt (limited to 'ext/spl/tests/SplFileObject_fputcsv_error.phpt') diff --git a/ext/spl/tests/SplFileObject_fputcsv_error.phpt b/ext/spl/tests/SplFileObject_fputcsv_error.phpt new file mode 100644 index 0000000..8368e42 --- /dev/null +++ b/ext/spl/tests/SplFileObject_fputcsv_error.phpt @@ -0,0 +1,35 @@ +--TEST-- +SplFileObject::fputcsv(): error conditions +--FILE-- +fputcsv() ); + +// more than expected no. of args +echo "-- Testing fputcsv() with more than expected number of arguments --\n"; +$fields = array("fld1", "fld2"); +$delim = ";"; +$enclosure ="\""; +var_dump( $fo->fputcsv($fields, $delim, $enclosure, $fo) ); + +echo "Done\n"; +--CLEAN-- + +--EXPECTF-- +*** Testing error conditions *** +-- Testing fputcsv() with zero argument -- + +Warning: SplFileObject::fputcsv() expects at least 1 parameter, 0 given in %s on line %d +NULL +-- Testing fputcsv() with more than expected number of arguments -- + +Warning: SplFileObject::fputcsv() expects at most 3 parameters, 4 given in %s on line %d +NULL +Done -- cgit v1.2.1