mirror of
https://github.com/pestphp/pest.git
synced 2026-06-08 12:12:17 +02:00
wip
This commit is contained in:
@ -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,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user