App\Lib\Codeception::loadTests PHP Method

loadTests() public method

Load the Codeception tests from disk.
public loadTests ( )
    public function loadTests()
    {
        if (!isset($this->config['tests'])) {
            return;
        }
        foreach ($this->config['tests'] as $type => $active) {
            // If the test type has been disabled in the Webception config,
            //      skip processing the directory read for those tests.
            if (!$active) {
                break;
            }
            $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator("{$this->config['paths']['tests']}" . $this->config['DS'] . "{$type}" . $this->config['DS'], \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
            // Iterate through all the files, and filter out
            //      any files that are in the ignore list.
            foreach ($files as $file) {
                if (!in_array($file->getFilename(), $this->config['ignore']) && $file->isFile()) {
                    // Declare a new test and add it to the list.
                    $test = new Test();
                    $test->init($type, $file);
                    $this->addTest($test);
                    unset($test);
                }
            }
        }
    }