summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt
diff options
context:
space:
mode:
authorSteve Seear <stevseea@php.net>2008-01-03 09:07:56 +0000
committerSteve Seear <stevseea@php.net>2008-01-03 09:07:56 +0000
commit261a88fc3a16c0b3b42fdbca98ac139f0329dbae (patch)
treea22cfa347daac6dbe7037a19972b0b80b42bec85 /ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt
parentc83b5662183c41d3eb3561ac39455d5b4c1a76d2 (diff)
downloadphp-git-261a88fc3a16c0b3b42fdbca98ac139f0329dbae.tar.gz
Adding PHPT tests for the ReflectionMethod class.
Diffstat (limited to 'ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt')
-rw-r--r--ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt163
1 files changed, 163 insertions, 0 deletions
diff --git a/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt b/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt
new file mode 100644
index 0000000000..bc2ac26931
--- /dev/null
+++ b/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt
@@ -0,0 +1,163 @@
+--TEST--
+ReflectionMethod::getDocComment()
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+/**
+ * My Doc Comment for A
+ */
+class A {
+ /**
+ * My Doc Comment for A::f
+ */
+ function f() {}
+
+ /**
+ * My Doc Comment for A::privf
+ */
+ private function privf() {}
+
+ /** My Doc Comment for A::protStatf */
+ protected static function protStatf() {}
+
+ /**
+
+ * My Doc Comment for A::finalStatPubf
+ */
+ final static public function finalStatPubf() {}
+
+}
+
+
+class B extends A {
+ /*** Not a doc comment */
+ function f() {}
+
+ /** *
+ * My Doc Comment for B::privf
+ */
+
+
+
+
+ private function privf() {}
+
+
+ /** My Doc Comment for B::protStatf
+
+
+
+
+ */
+ protected static function protStatf() {}
+
+}
+
+foreach (array('A', 'B') as $class) {
+ $rc = new ReflectionClass($class);
+ $rms = $rc->getMethods();
+ foreach ($rms as $rm) {
+ echo "\n\n---> Doc comment for $class::" . $rm->getName() . "():\n";
+ var_dump($rm->getDocComment());
+ }
+}
+?>
+--EXPECTF--
+
+
+---> Doc comment for A::f():
+string(%d) "/**
+ * My Doc Comment for A::f
+ */"
+
+
+---> Doc comment for A::privf():
+string(%d) "/**
+ * My Doc Comment for A::privf
+ */"
+
+
+---> Doc comment for A::protStatf():
+string(%d) "/** My Doc Comment for A::protStatf */"
+
+
+---> Doc comment for A::finalStatPubf():
+string(%d) "/**
+
+ * My Doc Comment for A::finalStatPubf
+ */"
+
+
+---> Doc comment for B::f():
+bool(false)
+
+
+---> Doc comment for B::privf():
+string(%d) "/** *
+ * My Doc Comment for B::privf
+ */"
+
+
+---> Doc comment for B::protStatf():
+string(%d) "/** My Doc Comment for B::protStatf
+
+
+
+
+ */"
+
+
+---> Doc comment for B::finalStatPubf():
+string(%d) "/**
+
+ * My Doc Comment for A::finalStatPubf
+ */"
+--UEXPECTF--
+---> Doc comment for A::f():
+unicode(%s) "/**
+ * My Doc Comment for A::f
+ */"
+
+
+---> Doc comment for A::privf():
+unicode(%s) "/**
+ * My Doc Comment for A::privf
+ */"
+
+
+---> Doc comment for A::protStatf():
+unicode(%s) "/** My Doc Comment for A::protStatf */"
+
+
+---> Doc comment for A::finalStatPubf():
+unicode(%s) "/**
+
+ * My Doc Comment for A::finalStatPubf
+ */"
+
+
+---> Doc comment for B::f():
+bool(false)
+
+
+---> Doc comment for B::privf():
+unicode(%s) "/** *
+ * My Doc Comment for B::privf
+ */"
+
+
+---> Doc comment for B::protStatf():
+unicode(%s) "/** My Doc Comment for B::protStatf
+
+
+
+
+ */"
+
+
+---> Doc comment for B::finalStatPubf():
+unicode(%s) "/**
+
+ * My Doc Comment for A::finalStatPubf
+ */"