redact($input); $this->assertSame($expected, $output, 'All three distinct Steam IDs should be replaced with the zero placeholder.'); } public function testNonSteamIdLongDigitsAreNotTouched(): void { // 13-digit Unix-millisecond timestamp (PZ log t: shape) and a 17-digit number // that does not begin with 76561198 — neither should be altered. $input = 't:1776297642406 score=12345678901234567'; $output = (new ProjectZomboidRedactor())->redact($input); $this->assertSame($input, $output, 'Non-SteamID digit sequences must not be modified.'); } public function testEmbeddedSteamIdInsideLongerAlphanumericTokenIsNotTouched(): void { // The SteamID64 pattern is embedded inside a longer alphanumeric token; // the negative lookaround boundaries should prevent a match. $input = 'token=abc76561198000000001def other=data'; $output = (new ProjectZomboidRedactor())->redact($input); $this->assertSame($input, $output, 'A Steam ID embedded inside an alphanumeric token must not be redacted.'); } public function testToggleOffLeavesSteamIdsIntact(): void { $input = 'Connected: 76561198111111111 and 76561198222222222.'; $output = (new ProjectZomboidRedactor()) ->redactSteamIds(false) ->redact($input); $this->assertSame($input, $output, 'With the Steam ID toggle disabled the original input must be returned unchanged.'); } }