rename user.class.php and User by noalyss_user.class.php and Noalyss_User
This commit is contained in:
parent
b525024728
commit
ae868936af
47 changed files with 97 additions and 103 deletions
|
|
@ -37,7 +37,7 @@ $_SESSION[SESSION_KEY.'csv_fieldsep']='0';
|
|||
$_SESSION[SESSION_KEY.'csv_decimal']='1';
|
||||
$_SESSION[SESSION_KEY.'csv_encoding']='utf8';
|
||||
$_SESSION[SESSION_KEY.'access_mode']='PC';
|
||||
$g_user=new User($g_connection);
|
||||
$g_user=new Noalyss_user($g_connection);
|
||||
$_ENV['TMP']="/tmp/";
|
||||
|
||||
require_once __DIR__.'/facility.class.php';
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ $_SESSION[SESSION_KEY.'csv_fieldsep']='0';
|
|||
$_SESSION[SESSION_KEY.'csv_decimal']='1';
|
||||
$_SESSION[SESSION_KEY.'csv_encoding']='utf8';
|
||||
$_SESSION[SESSION_KEY.'access_mode']='PC';
|
||||
$g_user=new User($g_connection);
|
||||
$g_user=new Noalyss_User($g_connection);
|
||||
$_ENV['TMP']="/tmp/";
|
||||
require_once __DIR__.'/facility.class.php';
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ define('USE_EMAIL', 'none@dev.null.eu');
|
|||
|
||||
/**
|
||||
* @backupGlobals enabled
|
||||
* @coversDefaultClass \User
|
||||
* @coversDefaultClass \Noalyss_User
|
||||
*/
|
||||
require DIRTEST.'/global.php';
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ class UserTest extends TestCase
|
|||
array(USE_ID, USE_FIRST_NAME, USE_NAME, USE_LOGIN, USE_ACTIVE, USE_PASS,
|
||||
USE_ADMIN, USE_EMAIL));
|
||||
|
||||
$this->object=new User($this->cn, USE_ID);
|
||||
$this->object=new Noalyss_user($this->cn, USE_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -58,7 +58,7 @@ class UserTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @covers User::load
|
||||
* @covers Noalyss_user::load
|
||||
*/
|
||||
public function testLoad()
|
||||
{
|
||||
|
|
@ -75,31 +75,31 @@ class UserTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @covers User::revoke_access
|
||||
* @covers Noalyss_user::revoke_access
|
||||
* @todo Implement testRevoke_access().
|
||||
*/
|
||||
public function testRevoke_access()
|
||||
{
|
||||
$cn_dossier=new Database(DOSSIER);
|
||||
User::revoke_access(USE_LOGIN, DOSSIER);
|
||||
Noalyss_user::revoke_access(USE_LOGIN, DOSSIER);
|
||||
$this->assertEquals($cn_dossier->get_value('select count(*) from profile_user where user_name =$1 ',
|
||||
array(USE_LOGIN)), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers User::grant_admin_access
|
||||
* @covers Noalyss_user::grant_admin_access
|
||||
* @todo Implement testGrant_admin_access()
|
||||
*/
|
||||
public function testGrant_admin_access()
|
||||
{
|
||||
$cn_dossier=new Database(DOSSIER);
|
||||
User::grant_admin_access(USE_LOGIN, DOSSIER);
|
||||
Noalyss_user::grant_admin_access(USE_LOGIN, DOSSIER);
|
||||
|
||||
$this->assertEquals($cn_dossier->get_value('select count(*) from profile_user where user_name =$1 ',
|
||||
array(USE_LOGIN)), 1);
|
||||
}
|
||||
/**
|
||||
* @covers User::remove_inexistant_user
|
||||
* @covers Noalyss_user::remove_inexistant_user
|
||||
*/
|
||||
public function testRemove_inexistant_user() {
|
||||
// insert inexisting user
|
||||
|
|
@ -111,7 +111,7 @@ class UserTest extends TestCase
|
|||
$this->assertEquals($cn->get_value('select count(*) from profile_user where user_name=$1',array('unknown/user')),1);
|
||||
|
||||
//remove him
|
||||
User::remove_inexistant_user(DOSSIER);
|
||||
Noalyss_user::remove_inexistant_user(DOSSIER);
|
||||
|
||||
// check his removal
|
||||
$this->assertEquals($cn->get_value('select count(*) from profile_user where user_name=$1',array('unknown/user')),0);
|
||||
|
|
@ -135,7 +135,7 @@ class UserTest extends TestCase
|
|||
*/
|
||||
public function testPeriode($p_id)
|
||||
{
|
||||
$this->object=new User(Dossier::connect(), USE_ID);
|
||||
$this->object=new Noalyss_user(Dossier::connect(), USE_ID);
|
||||
|
||||
$restore=$this->object->get_periode();
|
||||
$this->assertTrue(is_numeric($restore),"Old periode id is not an integer");
|
||||
|
|
@ -167,7 +167,7 @@ class UserTest extends TestCase
|
|||
public function testsql_writable_profile()
|
||||
{
|
||||
$cn=Dossier::connect();
|
||||
$user=new User($cn);
|
||||
$user=new Noalyss_user($cn);
|
||||
$_SESSION[SESSION_KEY.'use_admin']=0;
|
||||
$user->admin=0;
|
||||
$this->assertEquals(0 , $user->getAdmin()," Error user is admin");
|
||||
|
|
@ -22,7 +22,7 @@ class Acc_AccountTest extends TestCase
|
|||
$_REQUEST['gDossier']=DOSSIER;
|
||||
$g_connection=new Database(DOSSIER);
|
||||
$g_parameter=new Noalyss_Parameter_Folder($g_connection);
|
||||
$g_user=new User($g_connection);
|
||||
$g_user=new Noalyss_user($g_connection);
|
||||
$cn=Dossier::connect();
|
||||
$this->object=new Acc_Account($cn, '400');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class Acc_Account_LedgerTest extends TestCase
|
|||
$_REQUEST['gDossier']=DOSSIER;
|
||||
$g_connection=new Database(DOSSIER);
|
||||
$g_parameter=new Noalyss_Parameter_Folder($g_connection);
|
||||
$g_user=new User($g_connection);
|
||||
$g_user=new Noalyss_user($g_connection);
|
||||
$this->object=new Acc_Account_Ledger($g_connection, 400);
|
||||
$g_connection->exec_sql("update jrn_def set jrn_def_class_deb='4* 2*' where jrn_def_type='ODS'");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class Acc_BalanceTest extends TestCase
|
|||
public function testGet_row()
|
||||
{
|
||||
global $g_connection,$g_user;
|
||||
$g_user=new User($g_connection,1);
|
||||
$g_user=new Noalyss_user($g_connection,1);
|
||||
|
||||
$max=$g_connection->get_value("select max(p_id) from parm_periode");
|
||||
$min=$g_connection->get_value("select min(p_id) from parm_periode");
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ class Acc_Letter extends TestCase
|
|||
public function testDateLimitComputed($p_periode_id,$p_first_day,$p_last_day)
|
||||
{
|
||||
global $g_connection;
|
||||
$user=new User($g_connection);
|
||||
$user=new Noalyss_user($g_connection);
|
||||
$restore=$user->get_periode();
|
||||
$user->set_periode($p_periode_id);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class Noalyss_Parameter_FolderTest extends TestCase
|
|||
global $g_connection, $g_user;
|
||||
$_REQUEST['gDossier']=DOSSIER;
|
||||
$g_connection=new Database(DOSSIER);
|
||||
$g_user=new User($g_connection);
|
||||
$g_user=new Noalyss_user($g_connection);
|
||||
$this->object=new Noalyss_Parameter_Folder($g_connection);
|
||||
$this->a_param=explode(",","MY_COUNTRY,".
|
||||
"MY_DEFAULT_ROUND_ERROR_DEB,".
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue