bjori Wed Nov 15 07:58:02 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/file file_put_contents.phpt Log: Fix test (file_put_contents() now uses __toString) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/file_put_contents.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-src/ext/standard/tests/file/file_put_contents.phpt diff -u php-src/ext/standard/tests/file/file_put_contents.phpt:1.1.2.2 php-src/ext/standard/tests/file/file_put_contents.phpt:1.1.2.3 --- php-src/ext/standard/tests/file/file_put_contents.phpt:1.1.2.2 Mon May 29 10:42:54 2006 +++ php-src/ext/standard/tests/file/file_put_contents.phpt Wed Nov 15 07:58:02 2006 @@ -2,13 +2,18 @@ file_put_contents() and invalid parameters --FILE-- <?php - +class foo { + function __toString() { + return __METHOD__; + } +} $file = dirname(__FILE__)."/file_put_contents.txt"; $context = stream_context_create(); var_dump(file_put_contents($file, $context)); var_dump(file_put_contents($file, new stdClass)); +var_dump(file_put_contents($file, new foo)); $fp = fopen($file, "r"); var_dump(file_put_contents($file, "string", 0, $fp)); @@ -19,9 +24,8 @@ --EXPECTF-- Warning: file_put_contents(): supplied resource is not a valid stream resource in %s on line %d bool(false) - -Warning: file_put_contents(): The 2nd parameter should be either a string or an array in %s on line %d bool(false) +int(15) Warning: file_put_contents(): supplied resource is not a valid Stream-Context resource in %s on line %d int(6)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php