src/Runners/PHPUnit/SuiteLoader.php
public function load(string $path = '')
    {
        if ($path) {
            $testFileLoader = new TestFileLoader($this->options);
            $this->files = array_merge(
                $this->files,
                $testFileLoader->loadPath($path)
            );
        } elseif (
            isset($this->options->parallelSuite)
            && $this->options->parallelSuite
        ) {
            $this->suitesName = $this->configuration->getSuitesName();
        } elseif ($this->configuration->hasSuites()) {
            if (!empty($this->options->testsuite)) {
                $suites = [];
                foreach ($this->options->testsuite as $testsuite) {
                    $suites = array_merge($suites, $this->configuration->getSuiteByName($testsuite));
                }
            } else {
                $suites = $this->configuration->getSuites();
            }

            foreach ($suites as $suite) {
                foreach ($suite as $suitePath) {
                    $testFileLoader = new TestFileLoader($this->options);
                    $this->files = array_merge(
                        $this->files,
                        $testFileLoader->loadSuitePath($suitePath)
                    );
                }
            }
        }

        if (!$this->files && !\is_array($this->suitesName)) {
            throw new \RuntimeException('No path or configuration provided (tests must end with Test.php)');
        }

        $this->files = array_unique($this->files); // remove duplicates

        $this->initSuites();
    }
public function load(string $path = '')
    {
        if ($path) {
            $testFileLoader = new TestFileLoader($this->options);
            $this->files = array_merge(
                $this->files,
                $testFileLoader->loadPath($path)
            );
        } elseif (
            isset($this->options->parallelSuite)
            && $this->options->parallelSuite
        ) {
            $this->suitesName = $this->configuration->getSuitesName();
        } elseif ($this->configuration->hasSuites()) {
            if (!empty($this->options->testsuite)) {
                $suites = [];
                foreach ($this->options->testsuite as $testsuite) {
                    $suites = array_merge($suites, $this->configuration->getSuiteByName($testsuite));
                }
            } else {
                $suites = $this->configuration->getSuites();
            }

            foreach ($suites as $suite) {
                foreach ($suite as $suitePath) {
                    $testFileLoader = new TestFileLoader($this->options);
                    $this->files = array_merge(
                        $this->files,
                        $testFileLoader->loadSuitePath($suitePath)
                    );
                }
            }
        }

        if (!$this->files && !\is_array($this->suitesName)) {
            throw new \RuntimeException('No path or configuration provided (tests must end with Test.php)');
        }

        $this->files = array_unique($this->files); // remove duplicates

        $this->initSuites();
    }
public function load ( string $ path = '' ) { if ( $ path ) { $ testFileLoader = new TestFileLoader ( $ this -> options ) ; $ this -> files = array_merge ( $ this -> files , $ testFileLoader -> loadPath ( $ path ) ) ; } elseif ( isset ( $ this -> options -> parallelSuite ) && $ this -> options -> parallelSuite ) { $ this -> suitesName = $ this -> configuration -> getSuitesName ( ) ; } elseif ( $ this -> configuration -> hasSuites ( ) ) { if ( ! empty ( $ this -> options -> testsuite ) ) { $ suites = [ ] ; foreach ( $ this -> options -> testsuite as $ testsuite ) { $ suites = array_merge ( $ suites , $ this -> configuration -> getSuiteByName ( $ testsuite ) ) ; } } else { $ suites = $ this -> configuration -> getSuites ( ) ; } foreach ( $ suites as $ suite ) { foreach ( $ suite as $ suitePath ) { $ testFileLoader = new TestFileLoader ( $ this -> options ) ; $ this -> files = array_merge ( $ this -> files , $ testFileLoader -> loadSuitePath ( $ suitePath ) ) ; } } } if ( ! $ this -> files && ! \ is_array ( $ this -> suitesName ) ) { throw new \ RuntimeException ( 'No path or configuration provided (tests must end with Test.php)' ) ; } $ this -> files = array_unique ( $ this -> files ) ; // remove duplicates $ 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
Populates the loaded suite collection . Will load suites based off a phpunit xml configuration or a specified path .