24 require_once(dirname(__FILE__) .
'/../common-menu.php');
25 require_once(dirname(__FILE__) .
'/../common-parm.php');
33 protected function setUp()
42 print
"Starting unit test for common-menu.php\n";
43 print
"test function MenuPage()\n";
47 $Uri =
"http://fossology.org/repo/";
48 $expected =
"<a href='http:\/\/fossology.org\/repo\/&page=9'>\[Prev\]<\/a>";
49 $result =
MenuPage($Page, $TotalPage, $Uri);
50 $this->assertRegExp(
"/<b>11<\/b>/", $result);
51 $this->assertRegExp(
"/$expected/", $result);
59 print
"test function MenuEndlessPage()\n";
62 $Uri =
"http://fossology.org/repo/";
63 $expected =
"<a href='http:\/\/fossology.org\/repo\/&page=9'>\[Prev\]<\/a>";
65 $this->assertRegExp(
"/<b>11<\/b>/", $result);
66 $this->assertRegExp(
"/$expected/", $result);
74 print
"test function menu_cmp()\n";
78 $menua->Name =
'menua';
79 $menub->Name =
'menua';
81 $this->assertEquals(0,$result);
85 $this->assertEquals(1,$result);
92 print
"test function menu_insert()\n";
96 $Path =
"TestMenu::Test1::Test2";
100 $Target =
"TestTarget";
102 $countMenuListBefore = count($MenuList);
103 $result =
menu_insert($Path, $LastOrder, $URI, $Title, $Target, $HTML);
104 $this->assertEquals($Path,$MenuList[$countMenuListBefore]->FullName);
106 print
"test function menu_find)\n";
110 print
"test function menu_to_1html)\n";
112 $this->assertRegExp(
"/TestMenu/", $result);
114 print
"test function menu_to_1list)\n";
117 $this->assertRegExp(
"/TestMenu/", $result);
118 print
"Ending unit test for common-menu.php\n";