Style fixes from phpcs
This commit is contained in:
@@ -7,8 +7,16 @@
|
|||||||
* resulting rows match the expected (id, user, timestamp, description,
|
* resulting rows match the expected (id, user, timestamp, description,
|
||||||
* amount) tuples derived from the fixture.
|
* amount) tuples derived from the fixture.
|
||||||
*
|
*
|
||||||
|
* PHP version 8.1+
|
||||||
|
*
|
||||||
* Run: php tests/process_log_entries_test.php
|
* Run: php tests/process_log_entries_test.php
|
||||||
* Exit code 0 = pass.
|
* Exit code 0 = pass.
|
||||||
|
*
|
||||||
|
* @category Test
|
||||||
|
* @package TornVaultTracker
|
||||||
|
* @author Keith Solomon <ksolo@gmail.com>
|
||||||
|
* @license Unlicense https://unlicense.org/
|
||||||
|
* @link https://github.com/ksolo/Torn-Vault-Tracker
|
||||||
*/
|
*/
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
@@ -16,20 +24,38 @@ declare(strict_types=1);
|
|||||||
// Make USER_KEYS available without including config.php (it would force a
|
// Make USER_KEYS available without including config.php (it would force a
|
||||||
// real DB connection).
|
// real DB connection).
|
||||||
if (!defined('USER_KEYS')) {
|
if (!defined('USER_KEYS')) {
|
||||||
define('USER_KEYS', [
|
define(
|
||||||
|
'USER_KEYS', [
|
||||||
'zarathos' => 'test-key-not-used',
|
'zarathos' => 'test-key-not-used',
|
||||||
'symos' => 'test-key-not-used',
|
'symos' => 'test-key-not-used',
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once __DIR__ . '/../includes/exceptions.php';
|
require_once __DIR__ . '/../includes/exceptions.php';
|
||||||
require_once __DIR__ . '/../includes/utilities.php';
|
require_once __DIR__ . '/../includes/utilities.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print a failure message to STDERR and exit with status 1.
|
||||||
|
*
|
||||||
|
* @param string $message Human-readable failure description.
|
||||||
|
*
|
||||||
|
* @return never
|
||||||
|
*/
|
||||||
function fail(string $message): void {
|
function fail(string $message): void {
|
||||||
fwrite(STDERR, "FAIL: $message\n");
|
fwrite(STDERR, "FAIL: $message\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lightweight assertion helper that mirrors PHPUnit's assertSame().
|
||||||
|
*
|
||||||
|
* @param mixed $expected The expected value.
|
||||||
|
* @param mixed $actual The actual value.
|
||||||
|
* @param string $label Human-readable label for failure messages.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function assertSame($expected, $actual, string $label): void {
|
function assertSame($expected, $actual, string $label): void {
|
||||||
if ($expected !== $actual) {
|
if ($expected !== $actual) {
|
||||||
$exp = var_export($expected, true);
|
$exp = var_export($expected, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user