summaryrefslogtreecommitdiff
path: root/ext/spl/tests/class_implements_variation.phpt
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2008-10-17 14:34:55 +0000
committerZoe Slattery <zoe@php.net>2008-10-17 14:34:55 +0000
commitf591bffba92bd97fceb0f80315d4e6925084712d (patch)
treee4a84fb5026112002be4024316f8663900d6e0ae /ext/spl/tests/class_implements_variation.phpt
parent41ad9b4d1fdd8790aaabbbbd4e37e61adc93421a (diff)
downloadphp-git-f591bffba92bd97fceb0f80315d4e6925084712d.tar.gz
Committing for Robin Fernandes
Diffstat (limited to 'ext/spl/tests/class_implements_variation.phpt')
-rw-r--r--ext/spl/tests/class_implements_variation.phpt45
1 files changed, 45 insertions, 0 deletions
diff --git a/ext/spl/tests/class_implements_variation.phpt b/ext/spl/tests/class_implements_variation.phpt
new file mode 100644
index 0000000000..52fdbcaf70
--- /dev/null
+++ b/ext/spl/tests/class_implements_variation.phpt
@@ -0,0 +1,45 @@
+--TEST--
+SPL: Test class_implements() function : variation - no interfaces and autoload
+--FILE--
+<?php
+/* Prototype : array class_implements(mixed what [, bool autoload ])
+ * Description: Return all classes and interfaces implemented by SPL
+ * Source code: ext/spl/php_spl.c
+ * Alias to functions:
+ */
+
+echo "*** Testing class_implements() : variation ***\n";
+
+echo "--- testing no interfaces ---\n";
+class fs {}
+var_dump(class_implements(new fs));
+var_dump(class_implements('fs'));
+
+echo "\n--- testing autoload ---\n";
+var_dump(class_implements('non-existent'));
+var_dump(class_implements('non-existent2', false));
+
+
+function __autoload($classname) {
+ echo "attempting to autoload $classname\n";
+}
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing class_implements() : variation ***
+--- testing no interfaces ---
+array(0) {
+}
+array(0) {
+}
+
+--- testing autoload ---
+attempting to autoload non-existent
+
+Warning: class_implements(): Class non-existent does not exist and could not be loaded in %s on line %d
+bool(false)
+
+Warning: class_implements(): Class non-existent2 does not exist in %s on line %d
+bool(false)
+===DONE===