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');
34 require_once(
'../../../tests/testClasses/parseLicenseTblDirs.php');
57 print
"starting verifyFossDirsOnly-SetUp\n";
58 $name =
'fossDirsOnly.tar.bz2';
59 $safeName = escapeDots($name);
60 $this->host = getHost($URL);
64 $page = $this->mybrowser->get($URL);
65 $page = $this->mybrowser->clickLink(
'Browse');
66 $this->assertTrue($this->myassertText($page,
'/Browse/'),
67 "verifyDirsOnly FAILED! Could not find Browse menu\n");
68 $result = $this->myassertText($page,
"/$safeName/");
70 $this->fail(
"Failure, cannot find archive $name, Stopping test\n");
75 function testVerifyFossology()
81 print
"starting verifyFossDirsOnly test\n";
82 $page = $this->mybrowser->clickLink(
'Browse');
83 $this->assertTrue($this->myassertText($page,
'/Browse/'),
84 "verifyFossDirsOnly FAILED! Could not find Browse menu\n");
86 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
87 "verifyFossDirsOnly FAILED! did not find $name\n");
88 $this->assertTrue($this->myassertText($page,
"/>View</"),
89 "verifyFossDirsOnly FAILED! >View< not found\n");
90 $this->assertTrue($this->myassertText($page,
"/>Meta</"),
91 "verifyFossDirsOnly FAILED! >Meta< not found\n");
92 $this->assertTrue($this->myassertText($page,
"/>Download</"),
93 "verifyFossDirsOnly FAILED! >Download< not found\n");
96 $page = $this->mybrowser->clickLink($name);
98 $this->assertTrue($this->myassertText($page,
"/empty\//"),
99 "verifyFossDirsOnly FAILED! 'empty/' not found\n");
100 $this->assertTrue($this->myassertText($page,
"/1 item/"),
101 "verifyFossDirsOnly FAILED! '1 item' not found\n");
104 $page = $this->mybrowser->clickLink(
'empty/');
107 $this->assertTrue($this->myassertText($page,
"/9 items/"),
108 "verifyFossDirsOnly FAILED! '9 items' not found\n");
109 $this->assertTrue($this->myassertText($page,
"/agents/"),
110 "verifyFossDirsOnly FAILED! did not find 'agents' directory\n");
111 $this->assertTrue($this->myassertText($page,
"/scheduler/"),
112 "verifyFossDirsOnly FAILED! did not find scheduler directory\n");
117 $miniMenu = $mini->parseMiniMenu();
118 $url = makeUrl($this->host, $miniMenu[
'License']);
119 if($url === NULL) { $this->fail(
"verifyFossDirsOnly Failed, host is not set"); }
121 $page = $this->mybrowser->get($url);
123 $this->assertTrue($this->myassertText($page,
'/License Browser/'),
124 "verifyFossDirsOnly FAILED! License Browser Title not found\n");
125 $this->assertTrue($this->myassertText($page,
'/Total licenses: 0/'),
126 "verifyFossDirsOnly FAILED! Total Licenses does not equal 0\n");
129 $dirList = $dList->parseLicenseTblDirs();
136 $url = makeUrl($this->host, $dirList[
'scheduler/']);
137 $page = $this->mybrowser->get($url);
140 $dirCnt = $fList->countFiles();
142 $this->assertEqual((
int)$dirCnt, 1,
143 "verifyFossDirsOnly FAILED! did not get 1 folder path back, got $dirCnt instead\n");
146 $fpaths = $fList->parseFolderPath();
148 "verifyFossDirsOnly FAILED! something wrong with folder path\n" .
149 "See this url:\n$url\n");
165 $flistSize = count($folderPath[0]);
166 foreach($folderPath as $flist)
169 foreach($flist as $folder => $link)
173 if ($i == $flistSize)
175 $this->assertTrue(is_null($link),
176 "verifyFossDirsOnly FAILED! Last entry is not null\n$folder $link\n");
179 $this->assertFalse(is_null($link),
180 "verifyFossDirsOnly FAILED! Found a folder with no link\n$folder $link\n");
Login($User=NULL, $Password=NULL)