FOSSology  4.4.0
Open Source License Compliance by Open Source Software
addUserTest.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 
17 require_once ('../../../tests/fossologyTestCase.php');
18 require_once ('../../../tests/TestEnvironment.php');
19 
20 global $URL;
21 
23 {
24  public $mybrowser;
25  private $UserName;
26 
27  function setUP()
28  {
29  global $URL;
30  $this->Login();
31  }
32 
33  function testaddUser()
34  {
35  global $URL;
36 
37  print "starting AddUserTest\n";
38 
39  $loggedIn = $this->mybrowser->get($URL);
40  $this->assertTrue($this->myassertText($loggedIn, '/Admin/'));
41  $this->assertTrue($this->myassertText($loggedIn, '/Users/'));
42  $page = $this->mybrowser->get("$URL?mod=user_add");
43  //print "*********** Page after going to upload file **************\n$page\n";
44  $this->assertTrue($this->myassertText($page, '/Add A User/'));
45  $this->assertTrue($this->myassertText($page, '/To create a new user,/'));
46  $pid = getmypid();
47  $this->UserName = 'TestUser-' . "$pid";
48  $result = $this->addUser($this->UserName,'Created for testing','fosstester',1,1,'test');
49  }
50  function tearDown(){
51  /* Cleanup: remove the user */
52  print "Removing user $this->UserName\n";
53  $this->deleteUser($this->UserName);
54  }
55 }
addUser($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Password=NULL, $EmailNotify='y')
Login($User=NULL, $Password=NULL)