mirror of
https://github.com/pestphp/pest.git
synced 2026-03-09 17:27:22 +01:00
Adds initial implementation of --dirty option.
This commit is contained in:
@ -23,11 +23,6 @@ final class TestSuite
|
||||
*/
|
||||
public ?TestCase $test = null;
|
||||
|
||||
/**
|
||||
* Holds the tests repository.
|
||||
*/
|
||||
public TestRepository $tests;
|
||||
|
||||
/**
|
||||
* Holds the before each repository.
|
||||
*/
|
||||
@ -68,11 +63,12 @@ final class TestSuite
|
||||
*/
|
||||
public function __construct(
|
||||
string $rootPath,
|
||||
public string $testPath)
|
||||
public string $testPath,
|
||||
public TestRepository $tests = new TestRepository(),
|
||||
)
|
||||
{
|
||||
$this->beforeAll = new BeforeAllRepository();
|
||||
$this->beforeEach = new BeforeEachRepository();
|
||||
$this->tests = new TestRepository();
|
||||
$this->afterEach = new AfterEachRepository();
|
||||
$this->afterAll = new AfterAllRepository();
|
||||
$this->retryTempRepository = new TempRepository('retry');
|
||||
@ -83,10 +79,14 @@ final class TestSuite
|
||||
/**
|
||||
* Returns the current instance of the test suite.
|
||||
*/
|
||||
public static function getInstance(string $rootPath = null, string $testPath = null): TestSuite
|
||||
public static function getInstance(
|
||||
string $rootPath = null,
|
||||
string $testPath = null,
|
||||
TestRepository $tests = null,
|
||||
): TestSuite
|
||||
{
|
||||
if (is_string($rootPath) && is_string($testPath)) {
|
||||
self::$instance = new TestSuite($rootPath, $testPath);
|
||||
self::$instance = new TestSuite($rootPath, $testPath, $tests);
|
||||
|
||||
foreach (Plugin::$callables as $callable) {
|
||||
$callable();
|
||||
|
||||
Reference in New Issue
Block a user