]> granicus.if.org Git - php/commitdiff
- Update tests after MFH
authorMarcus Boerger <helly@php.net>
Wed, 10 May 2006 22:38:35 +0000 (22:38 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 10 May 2006 22:38:35 +0000 (22:38 +0000)
tests/lang/bug24658.phpt
tests/lang/type_hints_001.phpt
tests/lang/type_hints_002.phpt [new file with mode: 0644]
tests/lang/type_hints_003.phpt [new file with mode: 0644]

index d9bf0f5668b5a7ddb6e093864d9d88c42ae2b529..5f3b324b61ee9a4c506260a5c6fcd5c575547790 100644 (file)
@@ -53,4 +53,4 @@ int(2)
 object(foo)#%d (0) {
 }
 
-Fatal error: Argument 1 passed to typehint() must be an object of class foo in %s on line %d
+Catchable fatal error: Argument 1 passed to typehint() must be an object of class foo in %s on line %d
index 2b5f6c82876c3a2d54604bb301188713d3e25b56..dc14706a362b9add036001529a3ba48c256f2a54 100644 (file)
@@ -23,4 +23,4 @@ type_hint_foo($bar);
 ?>
 --EXPECTF--
 
-Fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, called in %s on line 16 and defined in %s on line 9
+Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, called in %s on line 16 and defined in %s on line 9
diff --git a/tests/lang/type_hints_002.phpt b/tests/lang/type_hints_002.phpt
new file mode 100644 (file)
index 0000000..b21240a
--- /dev/null
@@ -0,0 +1,28 @@
+--TEST--
+ZE2 type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class P { }
+class T {
+       function f(P $p = NULL) {
+               var_dump($p);
+               echo "-\n";
+       }
+}
+
+$o=new T();
+$o->f(new P);
+$o->f();
+$o->f(NULL);
+?>
+--EXPECT--
+object(P)#2 (0) {
+}
+-
+NULL
+-
+NULL
+-
+
diff --git a/tests/lang/type_hints_003.phpt b/tests/lang/type_hints_003.phpt
new file mode 100644 (file)
index 0000000..0ef3e35
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+ZE2 type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class T {
+       function f(P $p = 42) {
+       }
+}
+?>
+--EXPECTF--
+
+Fatal error: Default value for parameters with a class type hint can only be NULL in %stype_hints_003.php on line 3