Get all files from a suite.

@param $suite

@return array
484499
protected function getAllFilesFromSuite($suite)
    {
        if (!file_exists($suite->testsFullPath)) {
            die('FATAL ERROR: directory not found: '.$suite->testsFullPath.'.');
        }

        $files = Finder::create()->files()->in($suite->testsFullPath);

        if ($suite->file_mask) {
            $files->name($suite->file_mask);
        }

        return iterator_to_array($files, false);
    }
715961
public function findAllWithExtension($extensions)
	{
		$found = [];

		if (!is_array($extensions))
		{
			$extensions = [$extensions];
		}

		foreach ($this->getFlatListOfFiles() as $file)
		{
			$ext = $file->getExtension();
			if (in_array($ext, $extensions))
			{
				$found[] = $file;
			}
		}

		return $found;
	}
1347742
private function getSuitePaths(Suite $suite)
    {
        if (!is_array($suite->getSetting('paths'))) {
            throw new SuiteConfigurationException(
                sprintf('`paths` setting of the "%s" suite is expected to be an array, %s given.',
                    $suite->getName(),
                    gettype($suite->getSetting('paths'))
                ),
                $suite->getName()
            );
        }

        return $suite->getSetting('paths');
    }
1249266
private function getSuiteContexts(Suite $suite)
    {
        $contexts = $suite->getSetting('contexts');

        if (!is_array($contexts)) {
            throw new SuiteConfigurationException(
                sprintf('`contexts` setting of the "%s" suite is expected to be an array, `%s` given.',
                    $suite->getName(),
                    gettype($contexts)
                ),
                $suite->getName()
            );
        }

        return $contexts;
    }
292733
public function getAll()
    {
        $values = json_decode(file_get_contents($this->cacheFile), true);

        if( ! is_array($values)) return [];
        
        foreach ($values as $key => $value) {
            $values[$key] = unserialize($value);
        }
        return $values;
    }
1126871
public function getSuites()
    {
        if (!$this->xml) {
            return;
        }
        $suites = [];
        $nodes = $this->xml->xpath('//testsuites/testsuite');

        foreach ($nodes as $node) {
            $suites = array_merge_recursive($suites, $this->getSuiteByName((string) $node['name']));
        }

        return $suites;
    }
542434
public function getList(array $types = [])
    {
        $this->initialize();

        if (empty($types)) {
            return $this->files;
        }

        $images = in_array('image', $types);
        $docs = in_array('document', $types);
        $other = in_array('other', $types);
        $files = array_filter($this->files, function (FileInterface $file) use ($images, $docs, $other) {
            switch ($file->getType()) {
                case 'image':
                    return $images;
                case 'document':
                    return $docs;
                default:
                    return $other;
            }
        });
        $files = array_values($files); // normalize indexes

        return $files;
    }
480984
private function filesFromKey()
    {
        try {
            return $this->manager->files()[$this->file];
        } catch (\ErrorException $e) {
            $this->error(sprintf('Language file %s.php not found!', $this->file));

            return [];
        }
    }
490688
protected function getAllFiles(){
        $core = require __DIR__. '/Optimize/core.php';

        $proivers = config('compile.providers');
        $aliases   = config('compile.aliases');
        $files = array_merge($core, $proivers, $aliases);

        return $files;
    }
194399
public function find_all() {
        $this->ensure_path_exists();
        $files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);
        $return = array();
        if ($files === false) {
            return $return;
        }
        foreach ($files as $file) {
            $return[] = substr(basename($file), 0, -6);
        }
        return $return;
    }
71876
public function getAllFiles($index = null)
	{
		// return the selection
		if ($selection = (func_num_args() and ! is_null($index)) ? $this[$index] : $this->container)
		{
			// make sure selection is an array
			is_array($selection) or $selection = array($selection);
		}
		else
		{
			$selection = array();
		}

		return $selection;
	}
907720
protected static function loadSuiteConfig($suite, $path, $settings)
    {
        if (isset(self::$config['suites'][$suite])) {
            // bundled config
            return self::mergeConfigs($settings, self::$config['suites'][$suite]);
        }

        $suiteDir = self::$dir . DIRECTORY_SEPARATOR . $path;

        $suiteDistConf = self::getConfFromFile($suiteDir . DIRECTORY_SEPARATOR . "$suite.suite.dist.yml");
        $suiteConf = self::getConfFromFile($suiteDir . DIRECTORY_SEPARATOR . "$suite.suite.yml");

        // now we check the suite config file, if a extends key is defined
        if (isset($suiteConf['extends'])) {
            $presetFilePath = codecept_is_path_absolute($suiteConf['extends'])
                ? $suiteConf['extends'] // If path is absolute – use it
                : realpath($suiteDir . DIRECTORY_SEPARATOR . $suiteConf['extends']); // Otherwise try to locate it in the suite dir

            if (file_exists($presetFilePath)) {
                $settings = self::mergeConfigs(self::getConfFromFile($presetFilePath), $settings);
            }
        }

        $settings = self::mergeConfigs($settings, $suiteDistConf);
        $settings = self::mergeConfigs($settings, $suiteConf);

        return $settings;
    }
845503
protected function processSuite(Node\Suite $suite)
    {
        $currentSuite = [];

        if (is_array($suite->getFeatures())) {
            foreach ($suite->getFeatures() as $feature) {
                array_push($currentSuite, $this->processFeature($feature));
            }
        }

        return $currentSuite;
    }
1133001
private function getFiles()
    {
        $fieldname = $this->setting['fieldname'];
        if ($fieldname) {
            $_files = isset($_FILES[$fieldname]) ? $_FILES[$fieldname] : array();
            $files  = [$fieldname => $_files];
        } else {
            //all
            $files = $_FILES;
        }
        return $files;
    }
1216316
protected function getSuiteRootAttributes(array $suites)
    {
        return array_reduce($suites, function (array $result, TestSuite $suite): array {
            $result['tests'] += $suite->tests;
            $result['assertions'] += $suite->assertions;
            $result['failures'] += $suite->failures;
            $result['skipped'] += $suite->skipped;
            $result['errors'] += $suite->errors;
            $result['time'] += $suite->time;

            return $result;
        }, array_merge(['name' => $this->name], self::$defaultSuite));
    }
1101058
private function extractFooter(Suite $suite, Definition $definition)
    {
        $lines = array();
        $lines[] = strtr(
            '{space}<def_dimmed>|</def_dimmed> at `{path}`', array(
                '{space}' => str_pad('', mb_strlen($suite->getName(), 'utf8') + 1),
                '{path}'  => $definition->getPath()
            )
        );

        if ($this->isVerbose()) {
            $lines[] = strtr(
                '{space}<def_dimmed>|</def_dimmed> on `{filepath}[{start}:{end}]`', array(
                    '{space}' => str_pad('', mb_strlen($suite->getName(), 'utf8') + 1),
                    '{filepath}' => $definition->getReflection()->getFileName(),
                    '{start}' => $definition->getReflection()->getStartLine(),
                    '{end}' => $definition->getReflection()->getEndLine()
                )
            );
        }

        return $lines;
    }
455039
public function getFilesFromZip($file)
    {
        try {
            $files = $this->zip->set($file)->getList();
        } catch (Exception $e) {
            return array();
        }

        return count($files) < 2 ? array() : $files;
    }