This commit is contained in:
nuno maduro
2026-05-02 13:43:32 +01:00
parent 9b7c15d5b6
commit 631bbe318b
2 changed files with 21 additions and 6 deletions

View File

@ -16,12 +16,12 @@ use Symfony\Component\Console\Output\OutputInterface;
*/ */
final class TiaRequiresPestTests extends RuntimeException implements ExceptionInterface, Panicable, RenderlessEditor, RenderlessTrace 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( 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, $className,
$file, $filename,
)); ));
} }

View File

@ -27,8 +27,13 @@ use Whoops\Exception\Inspector;
/** /**
* @internal * @internal
*/ */
final readonly class Kernel final class Kernel
{ {
/**
* Either the kernel is terminated or not.
*/
private bool $terminated;
/** /**
* The Kernel bootstrappers. * The Kernel bootstrappers.
* *
@ -63,7 +68,7 @@ final readonly class Kernel
private Application $application, private Application $application,
private OutputInterface $output, private OutputInterface $output,
) { ) {
// $this->terminated = false;
} }
/** /**
@ -125,9 +130,13 @@ final readonly class Kernel
$configuration = Registry::get(); $configuration = Registry::get();
$result = Facade::result(); $result = Facade::result();
return CallsAddsOutput::execute( $result = CallsAddsOutput::execute(
Result::exitCode($configuration, $result), Result::exitCode($configuration, $result),
); );
$this->terminate();
return $result;
} }
/** /**
@ -135,6 +144,12 @@ final readonly class Kernel
*/ */
public function terminate(): void public function terminate(): void
{ {
if ($this->terminated) {
return;
}
$this->terminated = true;
$preBufferOutput = Container::getInstance()->get(KernelDump::class); $preBufferOutput = Container::getInstance()->get(KernelDump::class);
assert($preBufferOutput instanceof KernelDump); assert($preBufferOutput instanceof KernelDump);