From 9fa52474458e05820eb2bf05192c886573ab22b3 Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Mon, 3 Aug 2026 13:54:30 -0500 Subject: [PATCH] Style fixes from phpcs --- tests/process_log_entries_test.php | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tests/process_log_entries_test.php b/tests/process_log_entries_test.php index c19359f..39c8c6c 100644 --- a/tests/process_log_entries_test.php +++ b/tests/process_log_entries_test.php @@ -7,8 +7,16 @@ * resulting rows match the expected (id, user, timestamp, description, * amount) tuples derived from the fixture. * + * PHP version 8.1+ + * * Run: php tests/process_log_entries_test.php * Exit code 0 = pass. + * + * @category Test + * @package TornVaultTracker + * @author Keith Solomon + * @license Unlicense https://unlicense.org/ + * @link https://github.com/ksolo/Torn-Vault-Tracker */ declare(strict_types=1); @@ -16,20 +24,38 @@ declare(strict_types=1); // Make USER_KEYS available without including config.php (it would force a // real DB connection). if (!defined('USER_KEYS')) { - define('USER_KEYS', [ + define( + 'USER_KEYS', [ 'zarathos' => 'test-key-not-used', 'symos' => 'test-key-not-used', - ]); + ] + ); } require_once __DIR__ . '/../includes/exceptions.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 { fwrite(STDERR, "FAIL: $message\n"); 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 { if ($expected !== $actual) { $exp = var_export($expected, true);