Fixes --version and --help

This commit is contained in:
Nuno Maduro
2022-09-17 23:47:47 +01:00
parent 08b62f6633
commit 0e0e2adfbe
26 changed files with 511 additions and 86 deletions

View File

@ -59,16 +59,18 @@ final class BootFiles
}
/**
* Loads the given filename, if possible.
* Loads, if possible, the given file.
*/
private function load(string $filename): void
{
if (! Str::endsWith($filename, '.php')) {
return;
}
if (! file_exists($filename)) {
return;
}
include_once $filename;
}
}

View File

@ -6,6 +6,7 @@ namespace Pest\Bootstrappers;
use Pest\Subscribers;
use PHPUnit\Event;
use PHPUnit\Event\Subscriber;
/**
* @internal
@ -15,7 +16,7 @@ final class BootSubscribers
/**
* The Kernel subscribers.
*
* @var array<int, class-string<\PHPUnit\Event\Subscriber>>
* @var array<int, class-string<Subscriber>>
*/
private const SUBSCRIBERS = [
Subscribers\EnsureConfigurationIsValid::class,

View File

@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Pest\Bootstrappers;
use Pest\Support\View;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @internal
*/
final class BootView
{
public function __construct(
private readonly OutputInterface $output
) {
// ..
}
/**
* Boots the view renderer.
*/
public function __invoke(): void
{
View::renderUsing($this->output);
}
}