FOSSology  4.7.1
Open Source License Compliance by Open Source Software
AdminCustomTextManagementTest.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2025 Harshit Gandhi <gandhiharshit716@gmail.com>
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
12 require_once ('../../../tests/fossologyTestCase.php');
13 require_once ('../../../tests/TestEnvironment.php');
14 
15 global $URL;
16 
18 {
19  public $mybrowser;
20 
21  function setUp()
22  {
23  global $URL;
24  $this->Login();
25  }
26 
27  function testAdminCustomTextManagementAccess()
28  {
29  global $URL;
30 
31  print "Starting AdminCustomTextManagementTest\n";
32 
33  $loggedIn = $this->mybrowser->get($URL);
34  $this->assertTrue($this->myassertText($loggedIn, '/Admin/'));
35 
36  // Navigate to the custom text management page
37  $page = $this->mybrowser->get("$URL?mod=admin_custom_text_management");
38 
39  // Check if the page loads correctly
40  $this->assertTrue($this->myassertText($page, '/Custom Text Management/'));
41  $this->assertTrue($this->myassertText($page, '/Add New Custom Text/'));
42 
43  print "AdminCustomTextManagementTest completed successfully\n";
44  }
45 
46  function testAddCustomText()
47  {
48  global $URL;
49 
50  // Navigate to add new text page
51  $page = $this->mybrowser->get("$URL?mod=admin_custom_text_management&edit=0");
52 
53  // Check if the add form loads correctly
54  $this->assertTrue($this->myassertText($page, '/Text/'));
55  $this->assertTrue($this->myassertText($page, '/Acknowledgement/'));
56  $this->assertTrue($this->myassertText($page, '/Comments/'));
57  $this->assertTrue($this->myassertText($page, '/Associated License/'));
58 
59  print "Add custom text form test completed successfully\n";
60  }
61 }
Login($User=NULL, $Password=NULL)