diff --git a/test/Integration/HttpServerTest.php b/test/Integration/HttpServerTest.php index a0257ab..df0eb86 100644 --- a/test/Integration/HttpServerTest.php +++ b/test/Integration/HttpServerTest.php @@ -26,6 +26,7 @@ use org\bovigo\vfs\vfsStream as VirtualFilesystem; use org\bovigo\vfs\vfsStreamDirectory as VirtualDirectory; use org\bovigo\vfs\vfsStreamWrapper as VirtualStream; +use PHPUnit\Framework\Constraint\StringMatchesFormatDescription; use Ramsey\Uuid\Uuid; class HttpServerTest extends AsyncTestCase { @@ -127,22 +128,19 @@ public function testCorrectAccessLogOutputSendToStdout() : void { $request = new Request('http://localhost:4200/hello/world'); $client->request($request); - $expected = <<get(DummyMonologInitializer::class)->testHandler; self::assertInstanceOf(TestHandler::class, $handler); - self::assertStringMatchesFormat( - $expected, - join( - PHP_EOL, - array_map(static fn(LogRecord $logRecord) => $logRecord->formatted, $handler->getRecords()) - ) - ); + self::assertTrue($handler->hasInfoThatPasses(static function (LogRecord $record) { + $expected = <<evaluate( + other: $record->formatted, + returnResult: true + ); + })); } public function testExceptionThrowHasCorrectLogOutputSentToStdout() : void {