27 require_once(
'../fossologyTestCase.php');
28 require_once(
'../commonTestFuncs.php');
29 require_once(
'../TestEnvironment.php');
30 require_once(
'../testClasses/parseBrowseMenu.php');
31 require_once(
'../testClasses/parseMiniMenu.php');
32 require_once(
'../testClasses/parseFolderPath.php');
33 require_once(
'../testClasses/dom-parseLicenseTable.php');
34 require_once(
'libCopyRight.php');
57 $name =
'simpletest_1.0.1.tar.gz';
58 $safeName = escapeDots($name);
59 $this->host = getHost($URL);
63 $page = $this->mybrowser->get($URL);
64 $page = $this->mybrowser->clickLink(
'Browse');
65 $this->assertTrue($this->myassertText($page,
'/Browse/'),
66 "verifySimpletest FAILED! Could not find Browse menu\n");
67 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
68 "verifySimpleTest FAILED! Could not find simpletest_1.0.1.tar.gz upload\n");
69 $result = $this->myassertText($page,
"/$name/");
70 if(!($result)) { exit(FALSE); }
73 function testSimpletest()
80 print
"starting print url's\n";
81 $page = $this->mybrowser->clickLink(
'Browse');
82 $this->assertTrue($this->myassertText($page,
'/Browse/'),
83 "verifySimpleTest FAILED! Could not find Browse menu\n");
84 $this->assertTrue($this->myassertText($page,
"/Browse/"),
85 "verifySimpleTest FAILED! Browse Title not found\n");
86 $this->assertTrue($this->myassertText($page,
"/$safeName/"),
87 "verifySimpleTest FAILED! did not find $name\n");
88 $this->assertTrue($this->myassertText($page,
"/>View</"),
89 "verifySimpletest FAILED! >View< not found\n");
90 $this->assertTrue($this->myassertText($page,
"/>Info</"),
91 "verifySimpletest FAILED! >Info< not found\n");
92 $this->assertTrue($this->myassertText($page,
"/>Download</"),
93 "verifySimpletest FAILED! >Download< not found\n");
96 $page = $this->mybrowser->clickLink($name);
98 $this->assertTrue($this->myassertText($page,
"/simpletest\//"),
99 "verifySimpletest FAILED! 'simpletest/' not found\n");
100 $this->assertTrue($this->myassertText($page,
"/1 item/"),
101 "verifySimpletest FAILED! '1 item' not found\n");
106 $miniMenu = $mini->parseMiniMenu();
107 $url = makeUrl($this->host, $miniMenu[
'Copyright/Email/URL']);
108 if($url === NULL) { $this->fail(
"verifySimpletest Failed, host is not set"); }
110 $page = $this->mybrowser->get($url);
114 $ct->parseLicenseTbl();
117 $this->fail(
"Error! table with id=copyrighturl has no rows!" .
118 " nothing to process, There should be!\n");
120 else if(empty($ct->hList)) {
121 $this->fail(
"Error! table with id=copyrighturl was not found on" .
122 "the page, There should be one\n");
126 print
"\$urlStd = array(\n";
127 foreach($ct->hList as $list)
129 $cs = cleanString($list[
'textOrLink']);
130 print
"\t\t'$cs' => $list[count],\n";
131 $total += (int)$list[
'count'];
134 print
"Total URLs: $total\n";
Login($User=NULL, $Password=NULL)