phpunit more complete

This commit is contained in:
Laurent Destailleur
2025-10-17 19:39:45 +02:00
parent 993f821a3b
commit 384d40ca01
4 changed files with 10 additions and 5 deletions

View File

@@ -4046,9 +4046,10 @@ class Commande extends CommonOrder
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @param array<string|mixed> $param Array of options
* @return int
*/
public function initAsSpecimen()
public function initAsSpecimen($param = array())
{
global $conf, $langs;
@@ -4060,6 +4061,9 @@ class Commande extends CommonOrder
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."product";
$sql .= " WHERE entity IN (".getEntity('product').")";
if (array_key_exists('tosell', $param)) {
$sql .= " AND tosell = ".((int) $param['tosell']);
}
$sql .= $this->db->plimit(100);
$resql = $this->db->query($sql);