/** * Add a folder to the PHAR * * @param string $folder * @param array $ignore * * @return array */ protected function addFolder($folder, array $ignore = array()) { $finder = new Finder(); $finder = $finder->files()->ignoreVCS(true)->name('*.php')->in($folder); // Ignore some files or folders if ($ignore) { foreach ($ignore as $file) { $finder->exclude($file); } } $this->box->buildFromIterator($finder, dirname($folder)); return iterator_to_array($finder); }
public function testBuildFromIteratorInvalid() { $this->setExpectedException('Herrera\\Box\\Exception\\UnexpectedValueException', 'The iterator value "resource" was not expected.'); $this->box->buildFromIterator(new ArrayIterator(array('stream' => STDOUT))); }