16 require_once(
'../../../tests/fossologyTestCase.php');
17 require_once(
'../../../tests/commonTestFuncs.php');
18 require_once(
'../../../tests/TestEnvironment.php');
19 require_once(
'../../../tests/testClasses/parseBrowseMenu.php');
20 require_once(
'../../../tests/testClasses/parseMiniMenu.php');
21 require_once(
'../../../tests/testClasses/parseFolderPath.php');
22 require_once(
'../../../tests/testClasses/parseLicenseTbl.php');
42 $name =
'fossI16L518.tar.bz2';
43 $safeName = escapeDots($name);
44 $this->host = getHost($URL);
49 $page = $this->mybrowser->get($URL);
50 $page = $this->mybrowser->clickLink(
'Browse');
51 $this->assertTrue($this->myassertText($page,
'/Browse/'),
52 "verifyFossI16L518 FAILED! Could not find Browse menu\n");
53 $page = $this->mybrowser->clickLink(
'Testing');
54 $this->assertTrue($this->myassertText($page,
'/Testing/'),
55 "verifyFossI16L518 FAILED! Could not find Testing folder\n");
56 $result = $this->myassertText($page,
"/$safeName/");
57 if(!($result)) { exit(FALSE); }
60 function testVerifyFossI16L518()
66 print
"starting VerifyFossI16L518 test\n";
67 $page = $this->mybrowser->clickLink(
'Browse');
68 $this->assertTrue($this->myassertText($page,
'/Browse/'),
69 "verifyFossI16L518 FAILED! Could not find Browse menu\n");
71 $page = $this->mybrowser->clickLink(
'Testing');
73 $this->assertTrue($this->myassertText($page,
"/Browse/"),
74 "verifyFossI16L518 FAILED! Browse Title not found\n");
75 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
76 "verifyFossI16L518 FAILED! did not find $name\n");
77 $this->assertTrue($this->myassertText($page,
"/>View</"),
78 "verifyFossI16L518 FAILED! >View< not found\n");
79 $this->assertTrue($this->myassertText($page,
"/>Meta</"),
80 "verifyFossI16L518 FAILED! >Meta< not found\n");
81 $this->assertTrue($this->myassertText($page,
"/>Download</"),
82 "verifyFossI16L518 FAILED! >Download< not found\n");
85 $page = $this->mybrowser->clickLink($name);
87 $this->assertTrue($this->myassertText($page,
"/fossology\//"));
90 $page = $this->mybrowser->clickLink(
'fossology/');
95 $this->assertTrue($this->myassertText($page,
"/Makefile/"));
96 $this->assertTrue($this->myassertText($page,
"/mkcheck\.sh/"),
97 "FAIL! did not find mkcheck.sh\n");
98 $this->assertTrue($this->myassertText($page,
"/>View</"),
99 "FAIL! >View< not found\n");
100 $this->assertTrue($this->myassertText($page,
"/>Meta</"),
101 "FAIL! >Meta< not found\n");
102 $this->assertTrue($this->myassertText($page,
"/>Download</"),
103 "FAIL! >Download< not found\n");
108 $miniMenu = $mini->parseMiniMenu();
109 print
"DEBUG: miniMenu is:\n";print_r($miniMenu) .
"\n";
110 $url = makeUrl($this->host, $miniMenu[
'License']);
111 if($url === NULL) { $this->fail(
"verifyFossI16L518 Failed, host is not set"); }
113 $page = $this->mybrowser->get($url);
115 $this->assertTrue($this->myassertText($page,
'/License Browser/'),
116 "verifyFossI16L518 FAILED! License Browser Title not found\n");
117 $this->assertTrue($this->myassertText($page,
'/Total licenses: 518/'),
118 "verifyFossI16L518 FAILED! Total Licenses does not equal 518\n");
122 $licTable = $licTbl->parseLicenseTbl();
125 $pdURL = makeUrl($this->host, $licTable[
'Public Domain']);
126 $lgplURL = makeUrl($this->host, $licTable[
'\'LGPL v2.1\
'-style']);
128 $page = $this->mybrowser->get($pdURL);
130 $fileCount = $licFileList->countFiles();
131 print
"Checking the number of files based on Public Domain\n";
132 $this->assertEqual($fileCount, 4,
133 "verifyFossI16L518 FAILED! Should be 4 files based on Public Domain got:$fileCount\n");
135 $page = $this->mybrowser->get($lgplURL);
136 $licFileList->setPage($page);
137 $flist = $licFileList->countFiles();
138 print
"Checking the number of files based on LGPL v2.1-style\n";
139 $this->assertEqual($flist, 16,
140 "verifyFossI16L518 FAILED! Should be 16 files based on LGPL v2.1-style got:$flist\n");
Login($User=NULL, $Password=NULL)