FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
simpleUi-users.php
1 <?php
2 /***********************************************************
3  Copyright (C) 2011 Hewlett-Packard Development Company, L.P.
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  ***********************************************************/
18 
27 require_once ('fossologyTestCase.php');
28 require_once ('TestEnvironment.php');
29 
30 global $URL;
31 
33  public $mybrowser;
34  public $webProxy;
35 
36  function setUp() {
37  global $URL;
38  $this->Login();
39  }
40 
41  function testcreateSuiUsers()
42  {
43  global $URL;
44 
45  $Users = array(
46  'rouser' =>
47  'Read only test user: simple ui,NULL,1,1,NULL,NULL,rouser,n,1,simple',
48  'downloader' =>
49  'Download test user:simple ui,NULL,2,1,NULL,NULL,downloader,n,1,simple',
50  'rwuser' =>
51  'Read/Write test user: simple ui,NULL,3,1,NULL,NULL,rwuser,n,1,simple',
52  'uploader' =>
53  'Upload test user: simple ui,NULL,4,1,NULL,NULL,uploader,n,1,simple',
54  'anauser' =>
55  'Anaylyze test user: simple ui,NULL,5,1,NULL,NULL,anauser,n,1,simple',
56  );
57 
58  // create the user folder then the user
59  foreach($Users as $user => $parms)
60  {
61  list($description, $email, $access, $folder,
62  $pass1, $pass2, $Enote, $Bucketpool, $Ui) = split(',',$parms);
63  $created = $this->createFolder(1, $user, $description);
64  if($created == 0)
65  {
66  $this->fail("Could not create folder $user for user $user\n");
67  }
68  $page = $this->mybrowser->get("$URL?mod=folder_create");
69  $folderId = $this->getFolderId($user, $page, 'parentid');
70  //echo "suiu: folderid of user is:$folderId\n";
71  $added = $this->addUser($user, $description, $email, $access, $folderId,
72  $pass1 ,$Enote, $Bucketpool, $Ui);
73  if(preg_match('/User already exists/',$added, $matches)) {
74  $this->pass();
75  continue;
76  }
77  if(!empty($added)) {
78  $this->fail("User $user was not added to the fossology database\n$added\n");
79  }
80  }
81  }
82 }
83 ?>
createFolder($parent=null, $name, $description=null)
addUser($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Password=NULL, $EmailNotify= 'y')
getFolderId($folderName, $page, $selectName)
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Definition: nomos.h:321
Login($User=NULL, $Password=NULL)