Skip to content

Commit

Permalink
Update bulkgate-module-tester.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspijak authored Jul 2, 2020
1 parent 3f31c4e commit 96755fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bulkgate-module-tester.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ function same($excepted, $actual, $description, $optional = false)
}
else
{
return ($optional ? ("<b style=\"color: darkorange;\">OPTIONAL</b>") : ("<b style=\"color: red;\">FAIL</b>")) . " $description - <code>'$excepted'</code> must be same as <code>'$actual'</code><br/>";
$error = error_get_last(); $error_message = '';

if ($error !== null)
{
$error_message = $error['message'];
}

return ($optional ? ("<b style=\"color: darkorange;\">OPTIONAL</b>") : ("<b style=\"color: red;\">FAIL</b>")) . " $description - <b>Required:</b> <code>'$excepted'</code> must be same as <b>Actual:</b> <code>'$actual'</code><br/><b>ERROR: </b><code>$error_message</code><br/>";
}
}
?><!DOCTYPE html>
Expand Down Expand Up @@ -91,6 +98,7 @@ function same($excepted, $actual, $description, $optional = false)
<?= same('BulkGate Encode', json_decode('"BulkGate Encode"'), 'JSON decode') ?>
<?= same(true, function_exists('apache_request_headers'), 'Function: apache_request_headers', true) ?>
<?= same(true, function_exists('array_change_key_case'), 'Function: array_change_key_case') ?>
<?= same('{"message":"BulkGate API"}', file_get_contents('https://portal.bulkgate.com/api/welcome'), 'Portal connection ') ?>
</p>
<h2><?php
if ($tests === $success)
Expand Down

0 comments on commit 96755fb

Please sign in to comment.