forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_declared_classes_basic_001.phpt
More file actions
40 lines (32 loc) · 987 Bytes
/
get_declared_classes_basic_001.phpt
File metadata and controls
40 lines (32 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--TEST--
Test get_declared_classes() function : basic functionality
--FILE--
<?php
echo "*** Testing get_declared_classes() : basic functionality ***\n";
// Zero arguments
echo "\n-- Testing get_declared_classes() function with Zero arguments --\n";
var_dump(get_declared_classes());
foreach (get_declared_classes() as $class) {
if (!enum_exists($class) && !class_exists($class)) {
echo "Error: $class is not a valid class.\n";
}
}
echo "\n-- Ensure userspace classes are listed --\n";
Class C {}
var_dump(in_array('C', get_declared_classes()));
echo "\n-- Ensure userspace interfaces are not listed --\n";
Interface I {}
var_dump(in_array( 'I', get_declared_classes()));
echo "Done";
?>
--EXPECTF--
*** Testing get_declared_classes() : basic functionality ***
-- Testing get_declared_classes() function with Zero arguments --
array(%d) {
%a
}
-- Ensure userspace classes are listed --
bool(true)
-- Ensure userspace interfaces are not listed --
bool(false)
Done