FOSSology  4.4.0
Open Source License Compliance by Open Source Software
OneShot-lgpl2.1.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2008 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
17 require_once ('../../../tests/fossologyTestCase.php');
18 require_once ('../../../tests/TestEnvironment.php');
19 
20 global $URL;
21 
23 {
24  public $mybrowser;
25 
26  function setUp()
27  {
28  /* check to see if the user and material exist*/
29  $this->assertTrue(file_exists('/home/fosstester/.bashrc'),
30  "OneShotgplv21Test FAILURE! .bashrc not found\n");
31  $this->Login();
32  }
33 
34  function testOneShotgplv21()
35  {
36  global $URL;
37 
38  print "starting OneShotgplv21Test\n";
39  $loggedIn = $this->mybrowser->get($URL);
40  $this->assertTrue($this->myassertText($loggedIn, '/Upload/'),
41  "OneShotgplv21Test FAILED! Did not find Upload Menu\n");
42  $this->assertTrue($this->myassertText($loggedIn, '/One-Shot Analysis/'),
43  "OneShotgplv21Test FAILED! Did not find One-Shot Analysis Menu\n");
44 
45  $page = $this->mybrowser->get("$URL?mod=agent_nomos_once");
46  $this->assertTrue($this->myassertText($page, '/One-Shot License Analysis/'),
47  "OneShotgplv21Test FAILED! Did not find One-Shot License Analysis Title\n");
48  $this->assertTrue($this->myassertText($page, '/The analysis is done in real-time/'),
49  "OneShotgplv21Test FAILED! Did not find real-time Text\n");
50 
51  $this->assertTrue($this->mybrowser->setField('licfile', '/home/fosstester/licenses/gplv2.1'));
52  /* we won't select highlights' */
53  $this->assertTrue($this->mybrowser->clickSubmit('Analyze!'),
54  "FAILED! Count not click Analyze button\n");
55  /* Check for the correct analysis.... */
56  $page = $this->mybrowser->getContent();
57  $this->assertTrue($this->myassertText($page, '/LGPL_v2\.1/'),
58  "OneShotgplv21Test FAILED! Did not find exactly 'LGPL_v2.1'\n");
59 
60  $this->assertTrue($this->myassertText($page, '/One-Shot License Analysis/'),
61  "OneShotgplv21Test FAILED! Did not find One-Shot License Analysis Title\n");
62  // should not see -partial anymore
63  $this->assertFalse($this->myassertText($page, '/-partial/'),
64  "OneShotgplv21Test FAILED! Found -partial in a non partial license file\n");
65  }
66 }
Run one-shot license analysis on LGPL_v2.1 license.
setUp()
Setup the test cases and initialize the objects.
testOneShotgplv21()
Run NOMOS on GPL_v2.1 license.
Login($User=NULL, $Password=NULL)