/** * Populates the loaded suite collection. Will load suites * based off a phpunit xml configuration or a specified path * * @param string $path * @throws \RuntimeException */ public function load($path = '') { if (is_object($this->options) && isset($this->options->filtered['configuration'])) { $configuration = $this->options->filtered['configuration']; } else { $configuration = new Configuration(''); } if ($path) { $this->loadPath($path); } elseif (isset($this->options->testsuite) && $this->options->testsuite) { foreach ($configuration->getSuiteFiles($this->options->testsuite) as $file) { $this->loadFile($file); } foreach ($configuration->getSuites() as $suite) { foreach ($suite as $suitePath) { $this->loadPath($suitePath); } } $this->files = array_unique($this->files); // remove duplicates } elseif ($suites = $configuration->getSuites()) { foreach ($suites as $suite) { foreach ($suite as $suitePath) { $this->loadPath($suitePath); } } } if (!$this->files) { throw new \RuntimeException("No path or configuration provided (tests must end with Test.php)"); } $this->initSuites(); }
/** * Populates the loaded suite collection. Will load suites * based off a phpunit xml configuration or a specified path * * @param string $path * @throws \RuntimeException */ public function load($path = '') { if (is_object($this->options) && isset($this->options->filtered['configuration'])) { $configuration = $this->options->filtered['configuration']; } else { $configuration = new Configuration(''); } if ($path) { $this->loadPath($path); } elseif ($suites = $configuration->getSuites()) { foreach ($suites as $dirs) { foreach ($dirs as $path) { $this->loadPath($path); } } } if (!$this->files) { throw new \RuntimeException("No path or configuration provided (tests must end with Test.php)"); } $this->initSuites(); }