FIX SQL request and phpunit

This commit is contained in:
Laurent Destailleur 2020-02-05 13:41:10 +01:00
parent 2813c9d4b4
commit 9100b8a548
2 changed files with 9 additions and 13 deletions

View File

@ -1712,7 +1712,7 @@ class Holiday extends CommonObject
// We want only list of vacation balance for user ids // We want only list of vacation balance for user ids
$sql = "SELECT DISTINCT cpu.fk_user"; $sql = "SELECT DISTINCT cpu.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.user"; $sql.= " WHERE cpu.fk_user = u.rowid";
if ($filters) $sql.=$filters; if ($filters) $sql.=$filters;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -247,21 +247,17 @@ class HolidayTest extends PHPUnit\Framework\TestCase
$langs=$this->savlangs; $langs=$this->savlangs;
$db=$this->savdb; $db=$this->savdb;
//$localobject->fetch($localobject->id); $result = $localobject->fetchUsers(true, true, '');
$this->assertNotEquals($result, -1);
/* $result = $localobject->fetchUsers(true, false, '');
$result=$localobject->getNomUrl(1); $this->assertNotEquals($result, -1);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertNotEquals($result, '');
$result=$localobject->getFullAddress(1); $result = $localobject->fetchUsers(false, true, '');
print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertNotEquals($result, -1);
$this->assertContains("New address\nNew zip New town\nBelgium", $result);
$localobject->info($localobject->id); $result = $localobject->fetchUsers(false, false, '');
print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; $this->assertNotEquals($result, -1);
$this->assertNotEquals($localobject->date_creation, '');
*/
return $localobject->id; return $localobject->id;
} }