Skip to content

Commit

Permalink
Merge pull request #495 from tobald/unittest_fixes
Browse files Browse the repository at this point in the history
Provide some unit test fixes
  • Loading branch information
camlafit committed Jan 25, 2024
1 parent 21e6353 commit bd03632
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion bureau/class/db_mysql.php
Expand Up @@ -178,7 +178,8 @@ function query($Query_String, $arguments = false) {
}

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;
Expand Down
2 changes: 1 addition & 1 deletion bureau/class/m_action.php
Expand Up @@ -325,7 +325,7 @@ function finish($id, $return = 0) {
*/
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;
}
Expand Down
2 changes: 1 addition & 1 deletion bureau/class/m_dom.php
Expand Up @@ -944,7 +944,7 @@ function whois($domain) {
$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
}
Expand Down
4 changes: 2 additions & 2 deletions phpunit/tests/_datasets/actions-began.yml
@@ -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
4 changes: 2 additions & 2 deletions phpunit/tests/_datasets/actions-purgeable.yml
@@ -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
4 changes: 2 additions & 2 deletions phpunit/tests/_datasets/actions-ready.yml
@@ -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
1 change: 1 addition & 0 deletions phpunit/tests/bureau/class/m_domTest.php
Expand Up @@ -350,6 +350,7 @@ public function testWhois()
{
// 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',
Expand Down

0 comments on commit bd03632

Please sign in to comment.