Merge pull request #495 from tobald/unittest_fixes

Provide some unit test fixes
This commit is contained in:
Km 2024-01-25 15:24:48 +01:00 committed by Camille Lafitte
parent 21e6353314
commit bd03632163
7 changed files with 11 additions and 9 deletions

View File

@ -178,7 +178,8 @@ class DB_Sql {
}
if( defined("THROW_EXCEPTIONS") && THROW_EXCEPTIONS ){
throw new \Exception("Mysql query failed : $this->Error");
$error_msg=$this->Error[2];
throw new \Exception("Mysql query failed : $error_msg");
}
$this->halt("SQL Error: ".$Query_String);
return FALSE;

View File

@ -325,7 +325,7 @@ class m_action {
*/
function reset_job($id) {
global $db, $msg;
if (!$db->query("update actions set end=0,begin=0,status='' where id= ?;", array($id))) {
if (!$db->query("update actions set end=0,begin=0,status=0 where id= ?;", array($id))) {
$msg->raise("ERROR", "action", _("Error unlocking the action : $id"));
return false;
}

View File

@ -944,7 +944,7 @@ class m_dom {
$out=array();
exec("dig +short NS ".escapeshellarg($parent),$out);
$loopmax--;
} while (!count($out) && $loopmax); // will stop when : we have no parent, or
} while (!count($out) && $loopmax && strpos($parent, '.'));
if (!count($out)) {
return false; // bad exit of the loop
}

View File

@ -1,10 +1,10 @@
actions:
-
id: 999
type: "file"
type: CREATE_FILE
parameters: "phpunit"
creation: "2000-01-01 00:00:00"
begin: "2020-12-31 23:59:58"
end: "2020-12-31 23:59:59"
user: "phpunit"
status: 0
status: 0

View File

@ -1,10 +1,10 @@
actions:
-
id: 999
type: "file"
type: CREATE_FILE
parameters: "phpunit"
creation: "2000-01-01 00:00:00"
begin: "0000-00-00 00:00:00"
end: "0000-00-00 00:00:00"
user: "phpunit"
status: 0
status: 0

View File

@ -1,10 +1,10 @@
actions:
-
id: 999
type: "file"
type: CREATE_FILE
parameters: "phpunit"
creation: "2000-01-01 00:00:00"
begin: "2020-12-31 23:59:58"
end: "0000-00-00 00:00:00"
user: "phpunit"
status: 0
status: 0

View File

@ -350,6 +350,7 @@ class m_domTest extends TestCase
{
// Remove the following lines when you implement this test.
$ns = $this->object->whois('alternc.org');
sort($ns);
$expected_ns = array(
'primary.heberge.info',
'secondary.heberge.info',