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');
23 require_once(
'../../../tests/testClasses/parseLicenseTblDirs.php');
46 print
"starting verifyFossDirsOnly-SetUp\n";
47 $name =
'fossDirsOnly.tar.bz2';
48 $safeName = escapeDots($name);
49 $this->host = getHost($URL);
53 $page = $this->mybrowser->get($URL);
54 $page = $this->mybrowser->clickLink(
'Browse');
55 $this->assertTrue($this->myassertText($page,
'/Browse/'),
56 "verifyDirsOnly FAILED! Could not find Browse menu\n");
57 $result = $this->myassertText($page,
"/$safeName/");
59 $this->fail(
"Failure, cannot find archive $name, Stopping test\n");
64 function testVerifyFossology()
70 print
"starting verifyFossDirsOnly test\n";
71 $page = $this->mybrowser->clickLink(
'Browse');
72 $this->assertTrue($this->myassertText($page,
'/Browse/'),
73 "verifyFossDirsOnly FAILED! Could not find Browse menu\n");
75 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
76 "verifyFossDirsOnly FAILED! did not find $name\n");
77 $this->assertTrue($this->myassertText($page,
"/>View</"),
78 "verifyFossDirsOnly FAILED! >View< not found\n");
79 $this->assertTrue($this->myassertText($page,
"/>Meta</"),
80 "verifyFossDirsOnly FAILED! >Meta< not found\n");
81 $this->assertTrue($this->myassertText($page,
"/>Download</"),
82 "verifyFossDirsOnly FAILED! >Download< not found\n");
85 $page = $this->mybrowser->clickLink($name);
87 $this->assertTrue($this->myassertText($page,
"/empty\//"),
88 "verifyFossDirsOnly FAILED! 'empty/' not found\n");
89 $this->assertTrue($this->myassertText($page,
"/1 item/"),
90 "verifyFossDirsOnly FAILED! '1 item' not found\n");
93 $page = $this->mybrowser->clickLink(
'empty/');
96 $this->assertTrue($this->myassertText($page,
"/9 items/"),
97 "verifyFossDirsOnly FAILED! '9 items' not found\n");
98 $this->assertTrue($this->myassertText($page,
"/agents/"),
99 "verifyFossDirsOnly FAILED! did not find 'agents' directory\n");
100 $this->assertTrue($this->myassertText($page,
"/scheduler/"),
101 "verifyFossDirsOnly FAILED! did not find scheduler directory\n");
106 $miniMenu = $mini->parseMiniMenu();
107 $url = makeUrl($this->host, $miniMenu[
'License']);
108 if($url === NULL) { $this->fail(
"verifyFossDirsOnly Failed, host is not set"); }
110 $page = $this->mybrowser->get($url);
112 $this->assertTrue($this->myassertText($page,
'/License Browser/'),
113 "verifyFossDirsOnly FAILED! License Browser Title not found\n");
114 $this->assertTrue($this->myassertText($page,
'/Total licenses: 0/'),
115 "verifyFossDirsOnly FAILED! Total Licenses does not equal 0\n");
118 $dirList = $dList->parseLicenseTblDirs();
125 $url = makeUrl($this->host, $dirList[
'scheduler/']);
126 $page = $this->mybrowser->get($url);
129 $dirCnt = $fList->countFiles();
131 $this->assertEqual((
int)$dirCnt, 1,
132 "verifyFossDirsOnly FAILED! did not get 1 folder path back, got $dirCnt instead\n");
135 $fpaths = $fList->parseFolderPath();
137 "verifyFossDirsOnly FAILED! something wrong with folder path\n" .
138 "See this url:\n$url\n");
154 $flistSize = count($folderPath[0]);
155 foreach($folderPath as $flist)
158 foreach($flist as $folder => $link)
162 if ($i == $flistSize)
164 $this->assertTrue(is_null($link),
165 "verifyFossDirsOnly FAILED! Last entry is not null\n$folder $link\n");
168 $this->assertFalse(is_null($link),
169 "verifyFossDirsOnly FAILED! Found a folder with no link\n$folder $link\n");
Login($User=NULL, $Password=NULL)