16 require_once(
'../fossologyTestCase.php');
17 require_once(
'../commonTestFuncs.php');
18 require_once(
'../TestEnvironment.php');
19 require_once(
'../testClasses/parseBrowseMenu.php');
20 require_once(
'../testClasses/parseMiniMenu.php');
21 require_once(
'../testClasses/parseFolderPath.php');
22 require_once(
'../testClasses/dom-parseLicenseTable.php');
23 require_once(
'libCopyRight.php');
46 $name =
'simpletest_1.0.1.tar.gz';
47 $safeName = escapeDots($name);
48 $this->host = getHost($URL);
52 $page = $this->mybrowser->get($URL);
53 $page = $this->mybrowser->clickLink(
'Browse');
54 $this->assertTrue($this->myassertText($page,
'/Browse/'),
55 "verifySimpletest FAILED! Could not find Browse menu\n");
56 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
57 "verifySimpleTest FAILED! Could not find simpletest_1.0.1.tar.gz upload\n");
58 $result = $this->myassertText($page,
"/$name/");
59 if(!($result)) { exit(FALSE); }
62 function testSimpletest()
69 print
"starting print url's\n";
70 $page = $this->mybrowser->clickLink(
'Browse');
71 $this->assertTrue($this->myassertText($page,
'/Browse/'),
72 "verifySimpleTest FAILED! Could not find Browse menu\n");
73 $this->assertTrue($this->myassertText($page,
"/Browse/"),
74 "verifySimpleTest FAILED! Browse Title not found\n");
75 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
76 "verifySimpleTest FAILED! did not find $name\n");
77 $this->assertTrue($this->myassertText($page,
"/>View</"),
78 "verifySimpletest FAILED! >View< not found\n");
79 $this->assertTrue($this->myassertText($page,
"/>Info</"),
80 "verifySimpletest FAILED! >Info< not found\n");
81 $this->assertTrue($this->myassertText($page,
"/>Download</"),
82 "verifySimpletest FAILED! >Download< not found\n");
85 $page = $this->mybrowser->clickLink($name);
87 $this->assertTrue($this->myassertText($page,
"/simpletest\//"),
88 "verifySimpletest FAILED! 'simpletest/' not found\n");
89 $this->assertTrue($this->myassertText($page,
"/1 item/"),
90 "verifySimpletest FAILED! '1 item' not found\n");
95 $miniMenu = $mini->parseMiniMenu();
96 $url = makeUrl($this->host, $miniMenu[
'Copyright/Email/URL']);
97 if($url === NULL) { $this->fail(
"verifySimpletest Failed, host is not set"); }
99 $page = $this->mybrowser->get($url);
103 $ct->parseLicenseTbl();
106 $this->fail(
"Error! table with id=copyrighturl has no rows!" .
107 " nothing to process, There should be!\n");
109 else if(empty($ct->hList)) {
110 $this->fail(
"Error! table with id=copyrighturl was not found on" .
111 "the page, There should be one\n");
115 print
"\$urlStd = array(\n";
116 foreach($ct->hList as $list)
118 $cs = cleanString($list[
'textOrLink']);
119 print
"\t\t'$cs' => $list[count],\n";
120 $total += (int)$list[
'count'];
123 print
"Total URLs: $total\n";
Login($User=NULL, $Password=NULL)