Annotation of embedaddon/php/ext/spl/tests/class_uses_variation.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: Test class_uses() function : variation - no interfaces and autoload
3: --FILE--
4: <?php
5: /* Prototype : array class_uses(mixed what [, bool autoload ])
6: * Description: Return all traits used by a class
7: * Source code: ext/spl/php_spl.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing class_uses() : variation ***\n";
12:
13: echo "--- testing no traits ---\n";
14: class fs {}
15: var_dump(class_uses(new fs));
16: var_dump(class_uses('fs'));
17:
18: echo "\n--- testing autoload ---\n";
19: var_dump(class_uses('non-existent'));
20: var_dump(class_uses('non-existent2', false));
21:
22:
23: function __autoload($classname) {
24: echo "attempting to autoload $classname\n";
25: }
26:
27: ?>
28: ===DONE===
29: --EXPECTF--
30: *** Testing class_uses() : variation ***
31: --- testing no traits ---
32: array(0) {
33: }
34: array(0) {
35: }
36:
37: --- testing autoload ---
38: attempting to autoload non-existent
39:
40: Warning: class_uses(): Class non-existent does not exist and could not be loaded in %s on line %d
41: bool(false)
42:
43: Warning: class_uses(): Class non-existent2 does not exist in %s on line %d
44: bool(false)
45: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>