diff --git a/src/Exceptions/TiaRequiresPestTests.php b/src/Exceptions/TiaRequiresPestTests.php index 603fcd05..61614dc1 100644 --- a/src/Exceptions/TiaRequiresPestTests.php +++ b/src/Exceptions/TiaRequiresPestTests.php @@ -16,12 +16,12 @@ use Symfony\Component\Console\Output\OutputInterface; */ final class TiaRequiresPestTests extends RuntimeException implements ExceptionInterface, Panicable, RenderlessEditor, RenderlessTrace { - public function __construct(private readonly string $className, private readonly string $file) + public function __construct(private readonly string $className, private readonly string $filename) { parent::__construct(sprintf( - 'Tia mode requires Pest tests, but encountered PHPUnit class [%s] in [%s].', + 'Tia mode requires only functional based Pest tests, but encountered PHPUnit class [%s] in [%s].', $className, - $file, + $filename, )); } diff --git a/src/Kernel.php b/src/Kernel.php index 0bf3ba3a..d96a3190 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -27,8 +27,13 @@ use Whoops\Exception\Inspector; /** * @internal */ -final readonly class Kernel +final class Kernel { + /** + * Either the kernel is terminated or not. + */ + private bool $terminated; + /** * The Kernel bootstrappers. * @@ -63,7 +68,7 @@ final readonly class Kernel private Application $application, private OutputInterface $output, ) { - // + $this->terminated = false; } /** @@ -125,9 +130,13 @@ final readonly class Kernel $configuration = Registry::get(); $result = Facade::result(); - return CallsAddsOutput::execute( + $result = CallsAddsOutput::execute( Result::exitCode($configuration, $result), ); + + $this->terminate(); + + return $result; } /** @@ -135,6 +144,12 @@ final readonly class Kernel */ public function terminate(): void { + if ($this->terminated) { + return; + } + + $this->terminated = true; + $preBufferOutput = Container::getInstance()->get(KernelDump::class); assert($preBufferOutput instanceof KernelDump);