15 require_once (
'../../../tests/fossologyTestCase.php');
16 require_once (
'../../../tests/TestEnvironment.php');
17 require_once (TESTROOT .
'/testClasses/db.php');
29 function testNoEmailUser() {
33 $loggedIn = $this->mybrowser->get($URL);
34 $this->assertTrue($this->myassertText($loggedIn,
'/Admin/'));
35 $this->assertTrue($this->myassertText($loggedIn,
'/Users/'));
36 $page = $this->mybrowser->get(
"$URL?mod=user_add");
37 $this->assertTrue($this->myassertText($page,
'/Add A User/'));
38 $this->assertTrue($this->myassertText($page,
'/To create a new user,/'));
39 $result = $this->
addUser(
'UserNoEmail',
'No email notification user',
40 'fosstester', 1, 1,
'noetest', NULL);
41 if (!is_null($result)) {
47 if ($result !=
"User already exists. Not added") {
48 $this->fail(
"Did not add user UserwEmail result was:\n$result\n");
55 $dlink =
new db(
'host=localhost dbname=fossology user=fosstester password=fosstester;');
56 print
"Verifying User email notification setting\n";
57 $Sql =
"SELECT user_name, email_notify FROM users WHERE user_name='UserNoEmail';";
58 $User = $dlink->dbQuery($Sql);
59 print
"DB: User(SQL results) are:\n";print_r($User) .
"\n";
60 if((
int)$User[0][
'email_notify'] == 0) {
64 $this->fail(
"Fail! User UserNoEmail email_notify is not NULL\n");
65 printf(
"in octal the entry for email_notify is:%o\n",$User[0][
'email_notify']);
addUser($UserName, $Description=NULL, $Email=NULL, $Access=1, $Folder=1, $Password=NULL, $EmailNotify='y')
Login($User=NULL, $Password=NULL)