beforeAll = new BeforeAllRepository(); $this->beforeEach = new BeforeEachRepository(); $this->tests = new TestRepository(); $this->afterEach = new AfterEachRepository(); $this->afterAll = new AfterAllRepository(); $this->rootPath = (string) realpath($rootPath); } /** * Returns the current instance of the test suite. */ public static function getInstance( string $rootPath = null, string $testPath = null, ): TestSuite { if (is_string($rootPath) && is_string($testPath)) { self::$instance = new TestSuite($rootPath, $testPath); foreach (Plugin::$callables as $callable) { $callable(); } return self::$instance; } if (! self::$instance instanceof self) { Panic::with(new InvalidPestCommand()); } return self::$instance; } }