12 namespace Fossology\Tests;
14 use PHPUnit\Framework\TestCase;
15 use PHPUnit\Runner\Version as PHPUnitVersion;
17 require_once dirname(__FILE__) .
'/../common-menu.php';
18 require_once dirname(__FILE__) .
'/../common-parm.php';
33 $uri =
"http://fossology.org/repo/";
34 $expected =
"<a class='page-link' href='http://fossology.org/repo/&page=9'>Prev</a>";
35 $result =
MenuPage($page, $totalPage, $uri);
37 $this->assertStringContainsString(
"<a class='page-link' href='#'>11</a>", $result);
38 $this->assertStringContainsString($expected, $result);
47 $uri =
"http://fossology.org/repo/";
48 $expected =
"<a class='page-link' href='http://fossology.org/repo/&page=9'>Prev</a>";
51 $this->assertStringContainsString(
"<a class='page-link' href='#'>11</a>", $result);
52 $this->assertStringContainsString($expected, $result);
62 $menua->Name =
'menua';
63 $menub->Name =
'menua';
66 $this->assertEquals(0,
menu_cmp($menua, $menub));
71 $this->assertEquals(1,
menu_cmp($menua, $menub));
81 $path =
"TestMenu::Test1::Test2";
85 $target =
"TestTarget";
89 menu_insert($path, $lastOrder, $uri, $title, $target, $html);
92 $this->assertEquals($path,
$MenuList[$countMenuListBefore]->SubMenu[0]->SubMenu[0]->FullName);
99 $pattern =
"/TestMenu/";
100 if (intval(explode(
'.', PHPUnitVersion::id())[0]) >= 9) {
101 $this->assertMatchesRegularExpression($pattern, $result);
103 $this->assertRegExp($pattern, $result);
109 if (intval(explode(
'.', PHPUnitVersion::id())[0]) >= 9) {
110 $this->assertMatchesRegularExpression($pattern, $result);
112 $this->assertRegExp($pattern, $result);