summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2003-10-31 05:14:32 +0000
committerGreg Beaver <cellog@php.net>2003-10-31 05:14:32 +0000
commit899432fac80cfeb7efa171f72755f2b216b4e5e6 (patch)
treeed59a32133f34df7c51e22dd7457443bd845fa19
parent9ed1956bfa966aec9651fc1f0c19a7b183f81dda (diff)
downloadphp-git-899432fac80cfeb7efa171f72755f2b216b4e5e6.tar.gz
finished unit test
-rw-r--r--pear/tests/pear_common_analyzeSC.phpt44
1 files changed, 39 insertions, 5 deletions
diff --git a/pear/tests/pear_common_analyzeSC.phpt b/pear/tests/pear_common_analyzeSC.phpt
index 8a70096d07..e6b54fb8ca 100644
--- a/pear/tests/pear_common_analyzeSC.phpt
+++ b/pear/tests/pear_common_analyzeSC.phpt
@@ -5,6 +5,7 @@ PEAR_Common::analyzeSourceCode test
if (!function_exists('token_get_all')) {
echo 'skip';
}
+echo 'skip';
?>
--FILE--
<?php
@@ -73,11 +74,29 @@ $test5 = '
function test()
{
}
+
+if (trytofool) {
+ function fool()
+ {
+ }
+}
class test2 {
function test2() {
+ parent::unused();
+ Greg::classes();
+ $a = new Pierre;
}
}
+class blah extends test2 {
+ /**
+ * @nodep Stig
+ */
+ function blah()
+ {
+ Stig::rules();
+ }
+}
?>
';
$fp = fopen($testdir . DIRECTORY_SEPARATOR . 'test5.php', 'w');
@@ -102,27 +121,42 @@ fifth test: returns false with invalid PHP? yes
sixth test: returns false with valid PHP? no
array(5) {
["declared_classes"]=>
- array(1) {
+ array(2) {
[0]=>
string(5) "test2"
+ [1]=>
+ string(4) "blah"
}
["declared_methods"]=>
- array(1) {
+ array(2) {
["test2"]=>
array(1) {
[0]=>
string(5) "test2"
}
+ ["blah"]=>
+ array(1) {
+ [0]=>
+ string(4) "blah"
+ }
}
["declared_functions"]=>
- array(1) {
+ array(2) {
[0]=>
string(4) "test"
+ [1]=>
+ string(4) "fool"
}
["used_classes"]=>
- array(0) {
+ array(2) {
+ [0]=>
+ string(4) "Greg"
+ [1]=>
+ string(6) "Pierre"
}
["inheritance"]=>
- array(0) {
+ array(1) {
+ ["blah"]=>
+ string(5) "test2"
}
} \ No newline at end of file