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 ){ 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); $this->halt("SQL Error: ".$Query_String);
return FALSE; return FALSE;

View File

@ -325,7 +325,7 @@ class m_action {
*/ */
function reset_job($id) { function reset_job($id) {
global $db, $msg; 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")); $msg->raise("ERROR", "action", _("Error unlocking the action : $id"));
return false; return false;
} }

View File

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

View File

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

View File

@ -1,7 +1,7 @@
actions: actions:
- -
id: 999 id: 999
type: "file" type: CREATE_FILE
parameters: "phpunit" parameters: "phpunit"
creation: "2000-01-01 00:00:00" creation: "2000-01-01 00:00:00"
begin: "0000-00-00 00:00:00" begin: "0000-00-00 00:00:00"

View File

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

View File

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