]> granicus.if.org Git - php/commitdiff
- Fix tests
authorMarcus Boerger <helly@php.net>
Wed, 10 May 2006 22:46:16 +0000 (22:46 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 10 May 2006 22:46:16 +0000 (22:46 +0000)
Zend/tests/array_type_hint_001.phpt
Zend/tests/bug26166.phpt
Zend/tests/bug28444.phpt
Zend/tests/bug30791.phpt
Zend/tests/bug33771.phpt
Zend/tests/bug33996.phpt

index b8a8955f2dbb933c0711d1b0ffd4bb0ae53478df..4c4f048df76496cd8af6bc164591483fde825617 100755 (executable)
@@ -12,4 +12,4 @@ foo(123);
 --EXPECTF--
 3
 
-Fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
+Catchable fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
index 1c3934ac9176b0df954bc82fca71c524fdfe4bef..60624ed98ef78f23d0e48d54dce062a12abd2a43 100755 (executable)
@@ -2,6 +2,7 @@
 Bug #26166 (__toString() crash when no values returned)
 --FILE--
 <?php
+
 class Foo
 {
     function __toString()
@@ -28,6 +29,23 @@ class Bar
 $o = new Bar;
 echo $o;
 
+echo "===NONE===\n";
+
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+       var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
+class None
+{
+       function __toString() {
+       }
+}
+
+$o = new None;
+echo $o;
+
 echo "===THROW===\n";
 
 class Error 
@@ -45,23 +63,12 @@ catch (Exception $e) {
        echo "Got the exception\n";
 }
 
-echo "===NONE===\n";
-
-class None
-{
-       function __toString() {
-       }
-}
-
-$o = new None;
-echo $o;
-
 ?>
 ===DONE===
 --EXPECTF--
 Hello World!
-===THROW===
-Got the exception
 ===NONE===
+string(52) "Method None::__toString() must return a string value"
+===THROW===
 
-Fatal error: Method None::__toString() must return a string value in %sbug26166.php on line %d
+Fatal error: Method Error::__toString() must not throw an exception in %sbug26166.php on line %d
index f8a5513e0b9c88ff229e326bf53a6db9785407a3..3c8cfa6df7bb0b07474922d443a9e73c70c9c3a5 100755 (executable)
@@ -3,6 +3,12 @@ Bug #28444 (Cannot access undefined property for object with overloaded property
 --FILE--
 <?php
 
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+       var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
 class Object
 {
        public $x;
@@ -60,7 +66,8 @@ Overloaded::__set(y,3)
 int(3)
 Overloaded::__get(y)
 int(3)
-Overloaded::__set(z,Object id #3)
+string(55) "Object of class Object could not be converted to string"
+Overloaded::__set(z,)
 object(Object)#%d (1) {
   ["x"]=>
   int(4)
@@ -72,3 +79,27 @@ int(5)
 Overloaded::__get(z)
 int(6)
 ===DONE===
+--UEXPECTF--
+object(Object)#%d (1) {
+  [u"x"]=>
+  int(2)
+}
+int(2)
+int(3)
+Overloaded::__set(y,3)
+int(3)
+Overloaded::__get(y)
+int(3)
+unicode(55) "Object of class Object could not be converted to string"
+Overloaded::__set(z,)
+object(Object)#%d (1) {
+  [u"x"]=>
+  int(4)
+}
+Overloaded::__get(z)
+int(4)
+Overloaded::__get(z)
+int(5)
+Overloaded::__get(z)
+int(6)
+===DONE===
index f56bcfb6e7bd1af01f9e525dfead3f43250effa2..0cd0db37ac2c24278a03e46fcb3f693a701778ce 100755 (executable)
@@ -2,22 +2,43 @@
 Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded 
 --FILE--
 <?php
-class a {
+
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+       var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
+class a
+{
    public $a = 4;
    function __call($a,$b) {
        return "unknown method";
    }
 }
+
 $b = new a;
 echo $b,"\n";
 $c = unserialize(serialize($b));
 echo $c,"\n";
 var_dump($c);
+
 ?>
 --EXPECT--
-Object id #1
-Object id #2
+string(50) "Object of class a could not be converted to string"
+
+string(50) "Object of class a could not be converted to string"
+
 object(a)#2 (1) {
   ["a"]=>
   int(4)
 }
+--UEXPECT--
+unicode(50) "Object of class a could not be converted to string"
+
+unicode(50) "Object of class a could not be converted to string"
+
+object(a)#2 (1) {
+  [u"a"]=>
+  int(4)
+}
index 336aee8e878a210f5ebc515fa20d6a7e783cb519..07507685f3b8c7f317a0bde0e9861e4bc750efcb 100644 (file)
@@ -14,7 +14,7 @@ function make_exception()
 
 function make_exception_and_change_err_reporting()
 {
-       error_reporting(E_ALL);
+    error_reporting(E_ALL & ~E_STRICT);
     throw new Exception();
 }
 
@@ -34,7 +34,7 @@ var_dump(error_reporting());
 echo "Done\n";
 ?>
 --EXPECTF--    
-int(4095)
-int(4095)
-int(2047)
+int(8191)
+int(8191)
+int(6143)
 Done
index 1f02cae0f922a5d679cd054120d76d253b13842b..27fa60aaf9405a923bf6ef6ce20f2e95c7ebfd83 100755 (executable)
@@ -1,7 +1,7 @@
 --TEST--
 Bug #33996 (No information given for fatal error on passing invalid value to typed argument)
 --INI--
-error_reporting=4095
+error_reporting=8191
 --FILE--
 <?php
 class Foo
@@ -26,4 +26,5 @@ FooTest(new Foo());
 --EXPECTF--
 Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12
 Hi!
-Fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
+Catchable fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
+