diff --git a/tests/Stubs/ErrorHandler.php b/tests/Stubs/ErrorHandler.php index 34f02da..9c69a3b 100644 --- a/tests/Stubs/ErrorHandler.php +++ b/tests/Stubs/ErrorHandler.php @@ -8,12 +8,6 @@ class ErrorHandler extends AbstractTestErrorHandler { public function boot(): void { - file_put_contents( - __DIR__ . '/../_testdata/datapath/error-handler-events', - 'error reporting: ' . error_reporting(), - FILE_APPEND, - ); - $this->registerHandler(function (Throwable $exception) { $this->logErrorEvent($exception); }); diff --git a/tests/Stubs/PhpWarningJob.php b/tests/Stubs/PhpWarningJob.php index 37dbad9..2f7714f 100644 --- a/tests/Stubs/PhpWarningJob.php +++ b/tests/Stubs/PhpWarningJob.php @@ -11,6 +11,6 @@ class PhpWarningJob extends PpqJob */ public function invoke(): void { - unserialize('foo'); + $content = file_get_contents(__DIR__ . '/file-that-does-not-exist'); } } diff --git a/tests/_integration/ErrorHandlerTest.php b/tests/_integration/ErrorHandlerTest.php index 3e0a293..4c80860 100644 --- a/tests/_integration/ErrorHandlerTest.php +++ b/tests/_integration/ErrorHandlerTest.php @@ -68,13 +68,10 @@ $handlerEvents = file_get_contents(helper_testDataPath('error-handler-events')); - helper_dump($handlerEvents); - - helper_dump(Logs::getJobLog($job)); // @phpstan-ignore-line - expect($job?->status)->toBe(QueueJobStatus::finished) - ->and($handlerEvents)->toContain('PHP Warning: unserialize(): Error at offset 0 of 3 bytes'); -})->only(); + ->and($handlerEvents)->toContain('PHP Warning: file_get_contents(') + ->and($handlerEvents)->toContain('Failed to open stream: No such file or directory'); +}); it('handles a PHP error', function () { $job = Dispatcher::queue('default')