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