Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
da80bacf9b
@ -184,10 +184,10 @@ class Entrepot extends CommonObject
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$this->libelle = trim($this->libelle);
|
if (empty($this->label)) $this->label = $this->libelle; // For backward compatibility
|
||||||
|
|
||||||
// Si libelle non defini, erreur
|
$this->label = trim($this->label);
|
||||||
if ($this->libelle == '')
|
if ($this->label == '')
|
||||||
{
|
{
|
||||||
$this->error = "ErrorFieldRequired";
|
$this->error = "ErrorFieldRequired";
|
||||||
return 0;
|
return 0;
|
||||||
@ -198,7 +198,7 @@ class Entrepot extends CommonObject
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)";
|
||||||
$sql .= " VALUES ('".$this->db->escape($this->libelle)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")";
|
$sql .= " VALUES ('".$this->db->escape($this->label)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase
|
|||||||
$result=$localobject->create($user);
|
$result=$localobject->create($user);
|
||||||
|
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertLessThanOrEqual($result, 0);
|
$this->assertGreaterThan(0, $result);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -242,24 +242,4 @@ class EntrepotTest extends PHPUnit\Framework\TestCase
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* testEntrepotStatic
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function testEntrepotStatic()
|
|
||||||
{
|
|
||||||
global $conf,$user,$langs,$db;
|
|
||||||
$conf=$this->savconf;
|
|
||||||
$user=$this->savuser;
|
|
||||||
$langs=$this->savlangs;
|
|
||||||
$db=$this->savdb;
|
|
||||||
|
|
||||||
$localobject=new Entrepot($db);
|
|
||||||
|
|
||||||
//$this->assertLessThan(1, 0);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user