]> granicus.if.org Git - php/commitdiff
new test
authorDmitry Stogov <dmitry@php.net>
Fri, 9 Nov 2007 13:34:58 +0000 (13:34 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 9 Nov 2007 13:34:58 +0000 (13:34 +0000)
Zend/tests/ns_055.phpt [new file with mode: 0755]

diff --git a/Zend/tests/ns_055.phpt b/Zend/tests/ns_055.phpt
new file mode 100755 (executable)
index 0000000..83d0613
--- /dev/null
@@ -0,0 +1,33 @@
+--TEST--
+055: typehints in namespaces
+--FILE--
+<?php
+namespace test::ns1;
+
+class Foo {
+       function test1(Foo $x) {
+               echo "ok\n";
+       }
+       function test2(test::ns1::Foo $x) {
+               echo "ok\n";
+       }
+       function test3(Exception $x) {
+               echo "ok\n";
+       }
+       function test4(::Exception $x) {
+               echo "ok\n";
+       }
+}
+
+$foo = new Foo();
+$ex = new Exception();
+$foo->test1($foo);
+$foo->test2($foo);
+$foo->test3($ex);
+$foo->test4($ex);
+?>
+--EXPECT--
+ok
+ok
+ok
+ok