/** @covers \phpDocumentor\Fileset\Collection::getFollowSymlinks() */ public function testGetFollowSymlinksGivenTrue() { /* * NOTE: * this does not verify that symlinks were followed... * it simply exercises the getFollowSymlinks() method. */ $this->fixture->setFollowSymlinks(true); $this->assertTrue($this->fixture->getFollowSymlinks()); }
/** * Returns the collection of files based on the input and configuration. * * @param InputInterface $input * * @return Collection */ protected function getFileCollection($input) { /** @var ConfigurationHelper $configurationHelper */ $configurationHelper = $this->getHelper('phpdocumentor_configuration'); $this->files->setAllowedExtensions($configurationHelper->getOption($input, 'extensions', 'parser/extensions', array('php', 'php3', 'phtml'), true)); $this->files->setIgnorePatterns($configurationHelper->getOption($input, 'ignore', 'files/ignore', array(), true)); $ignoreHidden = $configurationHelper->getOption($input, 'hidden', 'files/ignore-hidden', 'off'); $this->files->setIgnoreHidden($ignoreHidden !== 'off' && $ignoreHidden === false); $this->files->setFollowSymlinks($configurationHelper->getOption($input, 'ignore-symlinks', 'files/ignore-symlinks', 'off') == 'on'); $file_options = (array) $configurationHelper->getOption($input, 'filename', 'files/files', array(), true); $added_files = array(); foreach ($file_options as $glob) { if (!is_string($glob)) { continue; } $matches = glob($glob); if (is_array($matches)) { foreach ($matches as $file) { if (!empty($file)) { $file = realpath($file); if (!empty($file)) { $added_files[] = $file; } } } } } $this->files->addFiles($added_files); $directory_options = $configurationHelper->getOption($input, 'directory', 'files/directories', array(), true); $added_directories = array(); foreach ($directory_options as $glob) { if (!is_string($glob)) { continue; } $matches = glob($glob, GLOB_ONLYDIR); if (is_array($matches)) { foreach ($matches as $dir) { if (!empty($dir)) { $dir = realpath($dir); if (!empty($dir)) { $added_directories[] = $dir; } } } } } $this->files->addDirectories($added_directories); return $this->files; }