Annotation of embedaddon/php/ext/reflection/tests/ReflectionClass_getDocComment_001.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: ReflectionClass::getDocComment()
3: --CREDITS--
4: Robin Fernandes <robinf@php.net>
5: Steve Seear <stevseea@php.net>
6: --FILE--
7: <?php
8: /**
9:
10:
11: My
12: Doc
13: * Comment
14: for A
15:
16: * */
17: class A {}
18:
19: /** My DocComment for B */
20: class B extends A { }
21:
22: class C extends B {}
23:
24: /**
25: * Interface doc comment
26: */
27:
28:
29:
30:
31: interface I {}
32:
33: /*.*
34: * Not a doc comment
35: */
36: class D implements I {}
37:
38: /**** Not a doc comment */
39: class E extends C implements I {} {}
40:
41: /**?** Not a doc comment */
42: class F extends C implements I {} {}
43:
44: /** ** Doc comment for G */
45: final class G extends C implements I {} {}
46:
47: $classes = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'I');
48: foreach ($classes as $class) {
49: echo "\n\n---> Doc comment for class $class:\n";
50: $rc = new ReflectionClass($class);
51: var_dump($rc->getDocComment());
52: }
53:
54:
55: ?>
56: --EXPECTF--
57:
58:
59: ---> Doc comment for class A:
60: string(%d) "/**
61:
62:
63: My
64: Doc
65: * Comment
66: for A
67:
68: * */"
69:
70:
71: ---> Doc comment for class B:
72: string(26) "/** My DocComment for B */"
73:
74:
75: ---> Doc comment for class C:
76: bool(false)
77:
78:
79: ---> Doc comment for class D:
80: bool(false)
81:
82:
83: ---> Doc comment for class E:
84: bool(false)
85:
86:
87: ---> Doc comment for class F:
88: bool(false)
89:
90:
91: ---> Doc comment for class G:
92: string(27) "/** ** Doc comment for G */"
93:
94:
95: ---> Doc comment for class I:
96: string(%d) "/**
97: * Interface doc comment
98: */"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>