16 require_once (
'../../../tests/fossologyTestCase.php');
17 require_once (
'../../../tests/TestEnvironment.php');
30 function testDupUser() {
33 print
"starting DupUserTest\n";
35 $loggedIn = $this->mybrowser->get($URL);
36 $this->assertTrue($this->myassertText($loggedIn,
'/Admin/'));
37 $this->assertTrue($this->myassertText($loggedIn,
'/Users/'));
38 $page = $this->mybrowser->get(
"$URL?mod=user_add");
39 $this->assertTrue($this->myassertText($page,
'/Add A User/'));
40 $this->assertTrue($this->myassertText($page,
'/To create a new user,/'));
41 $this->UserName =
'TestUserDup';
42 $this->
addUser($this->UserName,
'Created for Duplicate user testing',
'fosstester',1,1,
'test');
44 $page = $this->mybrowser->get(
"$URL?mod=user_add");
45 $this->assertTrue($this->myassertText($page,
'/Add A User/'));
46 $this->assertTrue($this->myassertText($page,
'/To create a new user,/'));
47 $result = $this->
addUser($this->UserName,
'Created for Duplicate user testing',
48 'fosstester',1,1,
'test');
50 $pattern =
"/User already exists\. Not added/";
51 if(preg_match($pattern,$result,$match)) {
55 $this->fail(
"Did not match string, got:\n$result\n");
61 print
"Removing user $this->UserName\n";
addUser($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Password=NULL, $EmailNotify='y')
Login($User=NULL, $Password=NULL)