summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorHannes Magnusson <bjori@php.net>2006-11-15 07:58:02 +0000
committerHannes Magnusson <bjori@php.net>2006-11-15 07:58:02 +0000
commit849a7857ac089f18ceadcca545ead8a30ee467d1 (patch)
tree322f034d21a31823f01fa09d9c1cf5b7cc4d495c /ext
parentfca0e244104090681902397daec66899183580b7 (diff)
downloadphp-git-849a7857ac089f18ceadcca545ead8a30ee467d1.tar.gz
Fix test (file_put_contents() now uses __toString)
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/tests/file/file_put_contents.phpt10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/standard/tests/file/file_put_contents.phpt b/ext/standard/tests/file/file_put_contents.phpt
index de08141b80..4566c37567 100644
--- a/ext/standard/tests/file/file_put_contents.phpt
+++ b/ext/standard/tests/file/file_put_contents.phpt
@@ -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 @@ echo "Done\n";
--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)