26 require_once (
'../../../tests/fossologyTestCase.php');
27 require_once (
'../../../tests/TestEnvironment.php');
28 require_once (TESTROOT .
'/testClasses/db.php');
42 function testEmailUser() {
45 print
"starting EmailUserTest\n";
47 print
"Creating user: UserwEmail\n";
48 $loggedIn = $this->mybrowser->get($URL);
49 $this->assertTrue($this->myassertText($loggedIn,
'/Admin/'));
50 $this->assertTrue($this->myassertText($loggedIn,
'/Users/'));
51 $page = $this->mybrowser->get(
"$URL?mod=user_add");
52 $this->assertTrue($this->myassertText($page,
'/Add A User/'));
53 $this->assertTrue($this->myassertText($page,
'/To create a new user,/'));
54 $result = $this->
addUser(
'UserwEmail',
'email notification user',
55 'fosstester', 1, 1,
'uwetest',
'y');
56 if (!is_null($result)) {
62 if ($result !=
"User already exists. Not added") {
63 $this->fail(
"Did not add user UserwEmail result was:\n$result\n");
69 print
"Verifying User email notification\n";
70 $dlink =
new db(
'host=localhost dbname=fossology user=fosstester password=fosstester');
71 $Sql =
"SELECT user_name, email_notify FROM users WHERE user_name='UserwEmail';";
72 $User = $dlink->dbQuery($Sql);
74 $this->assertEqual($User[0][
'email_notify'],
'y',
75 "Fail! User UserwEmail does not have email_notify set\n");
addUser($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Password=NULL, $EmailNotify= 'y')
Login($User=NULL, $Password=NULL)