FOSSology  4.4.0
Open Source License Compliance by Open Source Software
OneShot-lgpl2.1-T.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2008 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
19 require_once ('../../../tests/fossologyTestCase.php');
20 require_once ('../../../tests/TestEnvironment.php');
21 
22 global $URL;
23 
25 {
26  function setUp()
27  {
28  /* check to see if the user and material exist*/
29  $this->assertTrue(file_exists('/home/fosstester/.bashrc'),
30  "FAILURE! .bashrc not found\n");
31  $this->Login();
32  }
33 
34  function testOneShotTablegplv21()
35  {
36  global $URL;
37 
38  print "starting OneShotgplv21Test-Table\n";
39 
40  $loggedIn = $this->mybrowser->get($URL);
41  $this->assertTrue($this->myassertText($loggedIn, '/Upload/'),
42  "OneShotgplv21Test-Table FAILURE! Did not find Upload Menu\n");
43  $this->assertTrue($this->myassertText($loggedIn, '/One-Shot Analysis/'),
44  "OneShotgplv21Test-Table FAILURE! Did not find One-Shot Analysis Menu\n");
45 
46  $page = $this->mybrowser->get("$URL?mod=agent_license_once");
47  $this->assertTrue($this->myassertText($page, '/One-Shot License Analysis/'),
48  "OneShotgplv21Test-Table FAILURE! Did not find One-Shot License Analysis Title\n");
49  $this->assertTrue($this->myassertText($page, '/The analysis is done in real-time/'),
50  "OneShotgplv21Test-Table FAILURE! Did not find real-time Text\n");
51  $this->assertTrue($this->mybrowser->setField('licfile', '/home/fosstester/licenses/gplv2.1'));
52  /* select highlights' */
53  $this->assertTrue($this->mybrowser->setField('highlight', 1),
54  "OneShotgplv21Test-Table FAILURE! Could not click highlight\n");
55  $this->assertTrue($this->mybrowser->clickSubmit('Analyze!'),
56  "OneShotgplv21Test-Table FAILURE! Could not click Analyze button\n");
57  /* Check for the correct analysis....it should be 100% match, no partials */
58  //$page = $this->mybrowser->getContentAsText();
59  $page = $this->mybrowser->getContent();
60  //print "************ page a text (after analysis) *************\n$page\n";
61  $this->assertTrue($this->myassertText($page, '/One-Shot License Analysis/'),
62  "OneShotgplv21Test-Table FAILURE! Did not find One-Shot License Analysis Title\n");
63  $this->assertTrue($this->myassertText($page, '/Match/'),
64  "OneShotgplv21Test-Table FAILURE! Did not find text 'Match' \n");
65  $this->assertTrue($this->myassertText($page, '/100%/'),
66  "OneShotgplv21Test-Table FAILURE! Did not find '100percent\n");
67  $this->assertTrue($this->myassertText($page, '/LGPL v2\.1 Preamble/'),
68  "OneShotgplv21Test-Table FAILURE! Did not find 'LGPL v2.1 Preamble' \n");
69  $this->assertFalse($this->myassertText($page, '/-partial/'),
70  "OneShotgplv21Test-Table FAILURE! Found -partial in a non partial license file\n");
71  }
72 }
Login($User=NULL, $Password=NULL)