summaryrefslogtreecommitdiff
path: root/Zend/tests/010.phpt
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-06-27 21:10:04 +0000
committerAntony Dovgal <tony2001@php.net>2006-06-27 21:10:04 +0000
commit41ada4ba9b040a54461c651a9082ac445846e3f6 (patch)
treeac261b15fef0bc69ca649f1fc610374c43db0a70 /Zend/tests/010.phpt
parent29b0798cc8ecf8c150dcb7befb98f052965e6d5f (diff)
downloadphp-git-41ada4ba9b040a54461c651a9082ac445846e3f6.tar.gz
add new tests
Diffstat (limited to 'Zend/tests/010.phpt')
-rw-r--r--Zend/tests/010.phpt59
1 files changed, 59 insertions, 0 deletions
diff --git a/Zend/tests/010.phpt b/Zend/tests/010.phpt
new file mode 100644
index 0000000000..45e1832914
--- /dev/null
+++ b/Zend/tests/010.phpt
@@ -0,0 +1,59 @@
+--TEST--
+get_parent_class() tests
+--FILE--
+<?php
+
+interface i {
+ function test();
+}
+
+class foo implements i {
+ function test() {
+ var_dump(get_parent_class());
+ }
+}
+
+class bar extends foo {
+ function test_bar() {
+ var_dump(get_parent_class());
+ }
+}
+
+$bar = new bar;
+$foo = new foo;
+
+$foo->test();
+$bar->test();
+$bar->test_bar();
+
+var_dump(get_parent_class($bar));
+var_dump(get_parent_class($foo));
+var_dump(get_parent_class("bar"));
+var_dump(get_parent_class("foo"));
+var_dump(get_parent_class("i"));
+
+var_dump(get_parent_class(""));
+var_dump(get_parent_class("[[[["));
+var_dump(get_parent_class(" "));
+var_dump(get_parent_class(new stdclass));
+var_dump(get_parent_class(array()));
+var_dump(get_parent_class(1));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+bool(false)
+string(3) "foo"
+string(3) "foo"
+bool(false)
+string(3) "foo"
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+Done