FOSSology  4.4.0
Open Source License Compliance by Open Source Software
simpleUi-users.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2011 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
16 require_once ('fossologyTestCase.php');
17 require_once ('TestEnvironment.php');
18 
19 global $URL;
20 
22  public $mybrowser;
23  public $webProxy;
24 
25  function setUp() {
26  global $URL;
27  $this->Login();
28  }
29 
30  function testcreateSuiUsers()
31  {
32  global $URL;
33 
34  $Users = array(
35  'rouser' =>
36  'Read only test user: simple ui,NULL,1,1,NULL,NULL,rouser,n,1,simple',
37  'downloader' =>
38  'Download test user:simple ui,NULL,2,1,NULL,NULL,downloader,n,1,simple',
39  'rwuser' =>
40  'Read/Write test user: simple ui,NULL,3,1,NULL,NULL,rwuser,n,1,simple',
41  'uploader' =>
42  'Upload test user: simple ui,NULL,4,1,NULL,NULL,uploader,n,1,simple',
43  'anauser' =>
44  'Anaylyze test user: simple ui,NULL,5,1,NULL,NULL,anauser,n,1,simple',
45  );
46 
47  // create the user folder then the user
48  foreach($Users as $user => $parms)
49  {
50  list($description, $email, $access, $folder,
51  $pass1, $pass2, $Enote, $Bucketpool, $Ui) = explode(',',$parms);
52  $created = $this->createFolder(1, $user, $description);
53  if($created == 0)
54  {
55  $this->fail("Could not create folder $user for user $user\n");
56  }
57  $page = $this->mybrowser->get("$URL?mod=folder_create");
58  $folderId = $this->getFolderId($user, $page, 'parentid');
59  //echo "suiu: folderid of user is:$folderId\n";
60  $added = $this->addUser($user, $description, $email, $access, $folderId,
61  $pass1 ,$Enote, $Bucketpool, $Ui);
62  if(preg_match('/User already exists/',$added, $matches)) {
63  $this->pass();
64  continue;
65  }
66  if(!empty($added)) {
67  $this->fail("User $user was not added to the fossology database\n$added\n");
68  }
69  }
70  }
71 }
addUser($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Password=NULL, $EmailNotify='y')
createFolder($parent, $name, $description=null)
getFolderId($folderName, $page, $selectName)
Login($User=NULL, $Password=NULL)
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Definition: nomos.h:308