15 require_once (
'../../../tests/fossologyTestCase.php');
16 require_once (
'../../../tests/TestEnvironment.php');
17 require_once (TESTROOT .
'/testClasses/db.php');
31 function testEmailUser() {
34 print
"starting EmailUserTest\n";
36 print
"Creating user: UserwEmail\n";
37 $loggedIn = $this->mybrowser->get($URL);
38 $this->assertTrue($this->myassertText($loggedIn,
'/Admin/'));
39 $this->assertTrue($this->myassertText($loggedIn,
'/Users/'));
40 $page = $this->mybrowser->get(
"$URL?mod=user_add");
41 $this->assertTrue($this->myassertText($page,
'/Add A User/'));
42 $this->assertTrue($this->myassertText($page,
'/To create a new user,/'));
43 $result = $this->
addUser(
'UserwEmail',
'email notification user',
44 'fosstester', 1, 1,
'uwetest',
'y');
45 if (!is_null($result)) {
51 if ($result !=
"User already exists. Not added") {
52 $this->fail(
"Did not add user UserwEmail result was:\n$result\n");
58 print
"Verifying User email notification\n";
59 $dlink =
new db(
'host=localhost dbname=fossology user=fosstester password=fosstester');
60 $Sql =
"SELECT user_name, email_notify FROM users WHERE user_name='UserwEmail';";
61 $User = $dlink->dbQuery($Sql);
63 $this->assertEqual($User[0][
'email_notify'],
'y',
64 "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)