Add more log and phpunit
This commit is contained in:
parent
00a4359508
commit
0ab16b739a
@ -1638,7 +1638,7 @@ class Holiday extends CommonObject
|
|||||||
$sql.= " WHERE fk_user = '".$user_id."'";
|
$sql.= " WHERE fk_user = '".$user_id."'";
|
||||||
if ($fk_type > 0) $sql.=" AND fk_type = ".$fk_type;
|
if ($fk_type > 0) $sql.=" AND fk_type = ".$fk_type;
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::getCPforUser', LOG_DEBUG);
|
dol_syslog(get_class($this).'::getCPforUser user_id='.$user_id.' type_id='.$fk_type, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if($result)
|
if($result)
|
||||||
{
|
{
|
||||||
@ -1826,7 +1826,7 @@ class Holiday extends CommonObject
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// List of vacation balance users
|
// List of vacation balance users
|
||||||
$sql = "SELECT cpu.fk_user as userid, cpu.fk_type, cpu.nb_holiday, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user";
|
$sql = "SELECT cpu.fk_type, cpu.nb_holiday, u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as cpu, ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as cpu, ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE cpu.fk_user = u.rowid";
|
$sql.= " WHERE cpu.fk_user = u.rowid";
|
||||||
if ($filters) $sql.=$filters;
|
if ($filters) $sql.=$filters;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
|||||||
* @backupStaticAttributes enabled
|
* @backupStaticAttributes enabled
|
||||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||||
*/
|
*/
|
||||||
class HolidayTest extends PHPUnit_Framework_TestCase
|
class HolidayTest extends PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
protected $savconf;
|
protected $savconf;
|
||||||
protected $savuser;
|
protected $savuser;
|
||||||
@ -351,4 +351,19 @@ class HolidayTest extends PHPUnit_Framework_TestCase
|
|||||||
$result=$localobjectc->verifDateHolidayCP($user->id, $date_debut, $date_fin, 2); // start afternoon and end morning
|
$result=$localobjectc->verifDateHolidayCP($user->id, $date_debut, $date_fin, 2); // start afternoon and end morning
|
||||||
$this->assertTrue($result, 'result should be true, there is no overlapping');
|
$this->assertTrue($result, 'result should be true, there is no overlapping');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* testUpdateBalance
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testUpdateBalance()
|
||||||
|
{
|
||||||
|
$localobjecta=new Holiday($this->savdb);
|
||||||
|
|
||||||
|
$localobjecta->updateConfCP('lastUpdate', '20100101120000');
|
||||||
|
|
||||||
|
$localobjecta->updateBalance();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user