19 $where = dirname(__FILE__);
20 if(preg_match(
'!/home/jenkins.*?tests.*!', $where, $matches))
23 require_once (
'fossologyTestCase.php');
24 require_once(
'testClasses/parseMiniMenu.php');
25 require_once(
'testClasses/parseBrowseMenu.php');
26 require_once(
'commonTestFuncs.php');
32 require_once (
'../fossologyTestCase.php');
33 require_once(
'../testClasses/parseMiniMenu.php');
34 require_once(
'../testClasses/parseBrowseMenu.php');
35 require_once(
'../commonTestFuncs.php');
44 public $someOtherVariable;
56 $this->host = getHost($URL);
59 function testZendLic()
63 print
"starting testZendLic\n";
65 $name =
'zend-license';
66 $page = $this->mybrowser->clickLink(
'Browse');
67 $this->assertTrue($this->myassertText($page,
"/>View</"),
68 "ckzend FAILED! >View< not found\n");
69 $this->assertTrue($this->myassertText($page,
"/>Info</"),
70 "ckzend FAILED! >Info< not found\n");
71 $this->assertTrue($this->myassertText($page,
"/>Download</"),
72 "ckzend FAILED! >Download< not found\n");
73 $page = $this->mybrowser->clickLink(
'Testing');
74 $this->assertTrue($this->myassertText($page,
'/Testing/'),
75 "ckzend FAILED! Could not find Testing folder\n");
76 $this->assertTrue($this->myassertText($page,
"/$name/"),
77 "ckzend FAILED! did not find $name\n");
83 $browse->parseBrowseMenuFiles();
85 $viewLink = $browse->browseList[$name][
'View'];
86 $page = $this->mybrowser->get($viewLink);
88 $miniMenu = $mini->parseMiniMenu();
89 $url = makeUrl($this->host, $miniMenu[
'License Browser']);
90 if($url === NULL) { $this->fail(
"ckzend Failed, host/url is not set"); }
92 $this->assertTrue($this->myassertText($page,
'/View File/'),
93 "ckzend FAILED! View File Title not found\n");
94 $page = $this->mybrowser->get($url);
97 $matched = preg_match(
"/<hr>\nThe(.*?)<div class='text'>--/", $page, $matches);
99 $foundRaw = $matches[1];
100 $stripped = strip_tags($foundRaw);
101 $found = escapeDots($stripped);
103 $stringToMatch =
'Nomos license detector found: Zend_v2\.0';
104 $this->assertTrue($found,
"/$stringToMatch/",
105 "ckzend FAILED! Nomos license string does not match\n" .
106 "Expected: $stringToMatch\n" .
108 $this->assertTrue($this->myassertText($page,
'/View License/'),
109 "ckzend FAILED! View License Title not found\n");
111 $urlOneShot = makeUrl($this->host, $miniMenu[
'One-Shot License']);
112 if($urlOneShot === NULL) { $this->fail(
"ckzend Failed, cannot make One-Shot url"); }
113 $page = $this->mybrowser->get($urlOneShot);
114 $this->assertTrue($this->myassertText($page,
'/One-Shot License Analysis/'),
115 "ckzend FAILED! One-Shot License Analysis Title not found\n");
Login($User=NULL, $Password=NULL)