30 $where = dirname(__FILE__);
31 if(preg_match(
'!/home/jenkins.*?tests.*!', $where, $matches))
34 require_once (
'fossologyTestCase.php');
35 require_once(
'testClasses/parseMiniMenu.php');
36 require_once(
'testClasses/parseBrowseMenu.php');
37 require_once(
'commonTestFuncs.php');
43 require_once (
'../fossologyTestCase.php');
44 require_once(
'../testClasses/parseMiniMenu.php');
45 require_once(
'../testClasses/parseBrowseMenu.php');
46 require_once(
'../commonTestFuncs.php');
55 public $someOtherVariable;
67 $this->host = getHost($URL);
70 function testZendLic()
74 print
"starting testZendLic\n";
76 $name =
'zend-license';
77 $page = $this->mybrowser->clickLink(
'Browse');
78 $this->assertTrue($this->myassertText($page,
"/>View</"),
79 "ckzend FAILED! >View< not found\n");
80 $this->assertTrue($this->myassertText($page,
"/>Info</"),
81 "ckzend FAILED! >Info< not found\n");
82 $this->assertTrue($this->myassertText($page,
"/>Download</"),
83 "ckzend FAILED! >Download< not found\n");
84 $page = $this->mybrowser->clickLink(
'Testing');
85 $this->assertTrue($this->myassertText($page,
'/Testing/'),
86 "ckzend FAILED! Could not find Testing folder\n");
87 $this->assertTrue($this->myassertText($page,
"/$name/"),
88 "ckzend FAILED! did not find $name\n");
94 $browse->parseBrowseMenuFiles();
96 $viewLink = $browse->browseList[$name][
'View'];
97 $page = $this->mybrowser->get($viewLink);
99 $miniMenu = $mini->parseMiniMenu();
100 $url = makeUrl($this->host, $miniMenu[
'License Browser']);
101 if($url === NULL) { $this->fail(
"ckzend Failed, host/url is not set"); }
103 $this->assertTrue($this->myassertText($page,
'/View File/'),
104 "ckzend FAILED! View File Title not found\n");
105 $page = $this->mybrowser->get($url);
108 $matched = preg_match(
"/<hr>\nThe(.*?)<div class='text'>--/", $page, $matches);
110 $foundRaw = $matches[1];
111 $stripped = strip_tags($foundRaw);
112 $found = escapeDots($stripped);
114 $stringToMatch =
'Nomos license detector found: Zend_v2\.0';
115 $this->assertTrue($found,
"/$stringToMatch/",
116 "ckzend FAILED! Nomos license string does not match\n" .
117 "Expected: $stringToMatch\n" .
119 $this->assertTrue($this->myassertText($page,
'/View License/'),
120 "ckzend FAILED! View License Title not found\n");
122 $urlOneShot = makeUrl($this->host, $miniMenu[
'One-Shot License']);
123 if($urlOneShot === NULL) { $this->fail(
"ckzend Failed, cannot make One-Shot url"); }
124 $page = $this->mybrowser->get($urlOneShot);
125 $this->assertTrue($this->myassertText($page,
'/One-Shot License Analysis/'),
126 "ckzend FAILED! One-Shot License Analysis Title not found\n");
Login($User=NULL, $Password=NULL)