27 require_once(
'../../../tests/fossologyTestCase.php');
28 require_once(
'../../../tests/commonTestFuncs.php');
29 require_once(
'../../../tests/TestEnvironment.php');
30 require_once(
'../../../tests/testClasses/parseBrowseMenu.php');
31 require_once(
'../../../tests/testClasses/parseMiniMenu.php');
32 require_once(
'../../../tests/testClasses/parseFolderPath.php');
33 require_once(
'../../../tests/testClasses/parseLicenseTbl.php');
53 $name =
'fossI16L518.tar.bz2';
54 $safeName = escapeDots($name);
55 $this->host = getHost($URL);
60 $page = $this->mybrowser->get($URL);
61 $page = $this->mybrowser->clickLink(
'Browse');
62 $this->assertTrue($this->myassertText($page,
'/Browse/'),
63 "verifyFossI16L518 FAILED! Could not find Browse menu\n");
64 $page = $this->mybrowser->clickLink(
'Testing');
65 $this->assertTrue($this->myassertText($page,
'/Testing/'),
66 "verifyFossI16L518 FAILED! Could not find Testing folder\n");
67 $result = $this->myassertText($page,
"/$safeName/");
68 if(!($result)) { exit(FALSE); }
71 function testVerifyFossI16L518()
77 print
"starting VerifyFossI16L518 test\n";
78 $page = $this->mybrowser->clickLink(
'Browse');
79 $this->assertTrue($this->myassertText($page,
'/Browse/'),
80 "verifyFossI16L518 FAILED! Could not find Browse menu\n");
82 $page = $this->mybrowser->clickLink(
'Testing');
84 $this->assertTrue($this->myassertText($page,
"/Browse/"),
85 "verifyFossI16L518 FAILED! Browse Title not found\n");
86 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
87 "verifyFossI16L518 FAILED! did not find $name\n");
88 $this->assertTrue($this->myassertText($page,
"/>View</"),
89 "verifyFossI16L518 FAILED! >View< not found\n");
90 $this->assertTrue($this->myassertText($page,
"/>Meta</"),
91 "verifyFossI16L518 FAILED! >Meta< not found\n");
92 $this->assertTrue($this->myassertText($page,
"/>Download</"),
93 "verifyFossI16L518 FAILED! >Download< not found\n");
96 $page = $this->mybrowser->clickLink($name);
98 $this->assertTrue($this->myassertText($page,
"/fossology\//"));
101 $page = $this->mybrowser->clickLink(
'fossology/');
106 $this->assertTrue($this->myassertText($page,
"/Makefile/"));
107 $this->assertTrue($this->myassertText($page,
"/mkcheck\.sh/"),
108 "FAIL! did not find mkcheck.sh\n");
109 $this->assertTrue($this->myassertText($page,
"/>View</"),
110 "FAIL! >View< not found\n");
111 $this->assertTrue($this->myassertText($page,
"/>Meta</"),
112 "FAIL! >Meta< not found\n");
113 $this->assertTrue($this->myassertText($page,
"/>Download</"),
114 "FAIL! >Download< not found\n");
119 $miniMenu = $mini->parseMiniMenu();
120 print
"DEBUG: miniMenu is:\n";print_r($miniMenu) .
"\n";
121 $url = makeUrl($this->host, $miniMenu[
'License']);
122 if($url === NULL) { $this->fail(
"verifyFossI16L518 Failed, host is not set"); }
124 $page = $this->mybrowser->get($url);
126 $this->assertTrue($this->myassertText($page,
'/License Browser/'),
127 "verifyFossI16L518 FAILED! License Browser Title not found\n");
128 $this->assertTrue($this->myassertText($page,
'/Total licenses: 518/'),
129 "verifyFossI16L518 FAILED! Total Licenses does not equal 518\n");
133 $licTable = $licTbl->parseLicenseTbl();
136 $pdURL = makeUrl($this->host, $licTable[
'Public Domain']);
137 $lgplURL = makeUrl($this->host, $licTable[
'\'LGPL v2.1\
'-style']);
139 $page = $this->mybrowser->get($pdURL);
141 $fileCount = $licFileList->countFiles();
142 print
"Checking the number of files based on Public Domain\n";
143 $this->assertEqual($fileCount, 4,
144 "verifyFossI16L518 FAILED! Should be 4 files based on Public Domain got:$fileCount\n");
146 $page = $this->mybrowser->get($lgplURL);
147 $licFileList->setPage($page);
148 $flist = $licFileList->countFiles();
149 print
"Checking the number of files based on LGPL v2.1-style\n";
150 $this->assertEqual($flist, 16,
151 "verifyFossI16L518 FAILED! Should be 16 files based on LGPL v2.1-style got:$flist\n");
Login($User=NULL, $Password=NULL)