diff --git a/src/Kernel.php b/src/Kernel.php index 28232891..68de228b 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -163,7 +163,7 @@ final class Kernel $this->terminate(); if (is_array($error = error_get_last())) { - if (! in_array($error['type'], [E_ERROR, E_CORE_ERROR], true)) { + if (! in_array($error['type'], [E_ERROR, E_COMPILE_ERROR, E_CORE_ERROR], true)) { return; } diff --git a/src/KernelDump.php b/src/KernelDump.php index e1c67da5..4ecfe24b 100644 --- a/src/KernelDump.php +++ b/src/KernelDump.php @@ -68,6 +68,10 @@ final class KernelDump $type = 'INFO'; + if (is_array($error = error_get_last()) && in_array($error['type'], [E_ERROR, E_COMPILE_ERROR, E_CORE_ERROR], true)) { + return; + } + if ($this->isInternalError($this->buffer)) { $type = 'ERROR'; $this->buffer = str_replace( @@ -107,7 +111,6 @@ final class KernelDump */ private function isInternalError(string $output): bool { - return str_contains($output, 'An error occurred inside PHPUnit.') - || str_contains($output, 'Fatal error'); + return str_contains($output, 'An error occurred inside PHPUnit.'); } } diff --git a/src/Plugins/Parallel/Paratest/WrapperRunner.php b/src/Plugins/Parallel/Paratest/WrapperRunner.php index 074e76a6..900192f6 100644 --- a/src/Plugins/Parallel/Paratest/WrapperRunner.php +++ b/src/Plugins/Parallel/Paratest/WrapperRunner.php @@ -151,7 +151,6 @@ final class WrapperRunner implements RunnerInterface public function run(): int { $directory = dirname(__DIR__); - assert($directory !== ''); ExcludeList::addDirectory($directory); TestResultFacade::init(); EventFacade::instance()->seal(); diff --git a/tests/Arch.php b/tests/Arch.php index 82aa93da..f69c58df 100644 --- a/tests/Arch.php +++ b/tests/Arch.php @@ -33,13 +33,3 @@ arch('globals') ->expect(['dd', 'dump', 'ray', 'die', 'var_dump', 'sleep']) ->not->toBeUsed() ->ignoring(Expectation::class); - -arch('contracts') - ->expect('Pest\Contracts') - ->toOnlyUse([ - 'NunoMaduro\Collision\Contracts', - 'Pest\Factories\TestCaseMethodFactory', - 'Symfony\Component\Console', - 'Pest\Arch\Contracts', - 'Pest\PendingCalls', - ])->toBeInterfaces();