diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-03-21 13:13:17 +0000 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-03-21 13:13:17 +0000 |
commit | 54f0d50d3e7f23637de827c995a5bda64827640c (patch) | |
tree | a9ab2d18f88ef6000be4c33d3b11e821e23af04a | |
parent | 09e367dbaffa1e8c5ba7b88e9997d9ddc1c6d0c0 (diff) | |
download | php-git-54f0d50d3e7f23637de827c995a5bda64827640c.tar.gz |
Made some SplFileObject::fputcsv not pollute the working dir.
4 files changed, 15 insertions, 7 deletions
diff --git a/ext/spl/tests/SplFileObject_fputcsv_002.phpt b/ext/spl/tests/SplFileObject_fputcsv_002.phpt index ded467d7b7..db174931f7 100644 --- a/ext/spl/tests/SplFileObject_fputcsv_002.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv_002.phpt @@ -2,7 +2,7 @@ SplFileObject::fputcsv(): Checking data after calling the function --FILE-- <?php -$fo = new SplFileObject('SplFileObject_fputcsv.csv', 'w'); +$fo = new SplFileObject(__DIR__ . '/SplFileObject_fputcsv.csv', 'w'); $data = array(1, 2, 'foo', 'haha', array(4, 5, 6), 1.3, null); @@ -12,7 +12,8 @@ var_dump($data); ?> --CLEAN-- <?php -unlink('SplFileObject::fputcsv.csv'); +$file = __DIR__ . '/SplFileObject_fputcsv.csv'; +unlink($file); ?> --EXPECTF-- Notice: Array to string conversion in %s on line %d diff --git a/ext/spl/tests/SplFileObject_fputcsv_error.phpt b/ext/spl/tests/SplFileObject_fputcsv_error.phpt index aed2a978e5..8368e4211d 100644 --- a/ext/spl/tests/SplFileObject_fputcsv_error.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv_error.phpt @@ -2,7 +2,7 @@ SplFileObject::fputcsv(): error conditions --FILE-- <?php -$fo = new SplFileObject('SplFileObject_fputcsv.csv', 'w'); +$fo = new SplFileObject(__DIR__ . '/SplFileObject_fputcsv.csv', 'w'); echo "*** Testing error conditions ***\n"; // zero argument @@ -17,6 +17,11 @@ $enclosure ="\""; var_dump( $fo->fputcsv($fields, $delim, $enclosure, $fo) ); echo "Done\n"; +--CLEAN-- +<?php +$file = __DIR__ . '/SplFileObject_fputcsv.csv'; +unlink($file); +?> --EXPECTF-- *** Testing error conditions *** -- Testing fputcsv() with zero argument -- diff --git a/ext/spl/tests/SplFileObject_fputcsv_variation13.phpt b/ext/spl/tests/SplFileObject_fputcsv_variation13.phpt index 05f61958a5..b7c2a6381d 100644 --- a/ext/spl/tests/SplFileObject_fputcsv_variation13.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv_variation13.phpt @@ -8,7 +8,7 @@ Test fputcsv() : usage variations - with default enclosure & delimiter of two ch echo "*** Testing fputcsv() : with default enclosure & delimiter of two chars ***\n"; -$fo = new SplFileObject('SplFileObject_fputcsv.csv', 'w'); +$fo = new SplFileObject(__DIR__ . '/SplFileObject_fputcsv.csv', 'w'); var_dump($fo->fputcsv(array('water', 'fruit'), ',,', '"')); @@ -18,7 +18,8 @@ echo "Done\n"; ?> --CLEAN-- <?php -unlink('SplFileObject::fputcsv.csv'); +$file = __DIR__ . '/SplFileObject_fputcsv.csv'; +unlink($file); ?> --EXPECTF-- *** Testing fputcsv() : with default enclosure & delimiter of two chars *** diff --git a/ext/spl/tests/SplFileObject_fputcsv_variation14.phpt b/ext/spl/tests/SplFileObject_fputcsv_variation14.phpt index 6d1cc58486..f8cda0e96f 100644 --- a/ext/spl/tests/SplFileObject_fputcsv_variation14.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv_variation14.phpt @@ -8,7 +8,7 @@ Test fputcsv() : usage variations - with enclosure & delimiter of two chars echo "*** Testing fputcsv() : with enclosure & delimiter of two chars and file opened in read mode ***\n"; -$fo = new SplFileObject('SplFileObject_fputcsv.csv', 'w'); +$fo = new SplFileObject(__DIR__ . '/SplFileObject_fputcsv.csv', 'w'); var_dump($fo->fputcsv(array('water', 'fruit'), ',,', '""')); @@ -18,7 +18,8 @@ echo "Done\n"; ?> --CLEAN-- <?php -unlink('SplFileObject::fputcsv.csv'); +$file = __DIR__ . '/SplFileObject_fputcsv.csv'; +unlink($file); ?> --EXPECTF-- *** Testing fputcsv() : with enclosure & delimiter of two chars and file opened in read mode *** |