9 require_once
'PU_testcase_dcp.php';
20 $oParse = new \parseFamilyMethod();
21 $struct = $oParse->parse($callName);
22 $err = $struct->getError();
24 $this->assertEmpty(
$err, sprintf(
"function struct error detected : %s, %s",
$err, print_r($struct,
true)));
25 foreach ($expectedStructs as $key => $expectedValue) {
26 if (is_array($expectedValue)) {
27 $values = $struct->$key;
28 foreach ($expectedValue as $kv => $singleValue) {
29 if (is_array($singleValue)) {
30 foreach ($singleValue as $k => $v) {
31 $this->assertEquals($v, $values[$kv]->$k, sprintf(
"test struct %s/%s [%s]", $key, $k .
"[$kv]", print_r($values,
true)));
34 $this->assertEquals($singleValue, $values[$kv], sprintf(
"testout struct %s/%s ", $key .
"[$kv]", print_r($struct,
true)));
38 $this->assertEquals($expectedValue, $struct->$key);
51 $oParse = new \parseFamilyMethod();
52 $struct = $oParse->parse($callName);
53 $err = $struct->getError();
55 $this->assertNotEmpty(
$err, sprintf(
"function struct no error detected :%s", print_r($struct,
true)));
56 foreach ($expectedErrors as $expectedError) {
58 $this->assertContains($expectedError,
$err, sprintf(
'not the correct error reporting : "%s" : %s',
$err, print_r($struct,
true)));
69 "methodName" =>
"getTitle",
79 "methodName" =>
"getTitle",
85 "myClass::getTitle ()",
87 "methodName" =>
"getTitle",
88 "className" =>
"myClass"
93 '::getTitle( "ONE" ): OUT',
95 "methodName" =>
"getTitle",
109 'foo\\bar::getSomething("ONE","TWO"):OUT',
111 "methodName" =>
"getSomething",
112 "className" =>
"foo\\bar",
157 "class one::testTwo()",
164 "::testTwo():ONE,TWO",
testParseMethodCall($callName, $expectedStructs)
testParseMethodCallErrors($callName, $expectedErrors)
if($file) if($subject==""&&$file) if($subject=="") $err