Skip to content

Commit 5b64c58

Browse files
committed
Improve tests.
1 parent 3abf954 commit 5b64c58

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
// Suppress unexpected errors from output and exit early as a failure when encountered.
1717
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
18+
echo 'Error triggered: ' . $errstr . PHP_EOL;
1819
exit(1);
1920
});
2021

@@ -34,6 +35,7 @@
3435

3536
$Autoloader = __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
3637
if (!is_readable($Autoloader)) {
38+
echo 'Autoloader is not readable.' . PHP_EOL;
3739
exit(2);
3840
}
3941
require $Autoloader;
@@ -49,13 +51,15 @@
4951
unset($ZipObj);
5052
$SigPath = $TestsPath . 'signatures';
5153
} else {
54+
echo 'Problem encountered trying to open signatures.zip.' . PHP_EOL;
5255
exit(3);
5356
}
5457

5558
$Samples = $TestsPath . 'samples';
5659

5760
$Config = $TestsPath . 'phpmussel.yml';
5861
if (!is_readable($Config) || !is_readable($Samples) || !is_readable($SigPath)) {
62+
echo 'Configuration, samples, or signatures are not readable.' . PHP_EOL;
5963
exit(4);
6064
}
6165

@@ -85,10 +89,11 @@
8589
$Actual = $Scanner->scan($Samples, 3);
8690
ksort($Actual);
8791
if ($Actual !== $Expected) {
92+
echo 'Actual scan results does not match expected scan results.' . PHP_EOL;
8893
exit(5);
8994
}
9095

9196
restore_error_handler();
9297

93-
// All tests passed.
98+
echo 'All tests passed.' . PHP_EOL;
9499
exit(0);

0 commit comments

Comments
 (0)