public function testFindHandler() { $f = new Finder(); $f->addPath(__DIR__ . '/../resources/one'); $f->returnHandlers(); $this->assertInstanceOf('Fuel\\FileSystem\\File', $f->findFile('a')); $f = new Finder(); $f->addPath(__DIR__ . '/../resources/one'); $f->addPath(__DIR__ . '/../resources'); $f->asHandlers(); $this->assertInstanceOf('Fuel\\FileSystem\\File', $f->findFile('a')); $f->asHandlers(); $this->assertInstanceOf('Fuel\\FileSystem\\Directory', $f->findDir('one')); $f->returnHandlers(); $this->assertContainsOnlyInstancesOf('Fuel\\FileSystem\\File', $f->findAllFiles('a')); $this->assertContainsOnlyInstancesOf('Fuel\\FileSystem\\Directory', $f->findAllDirs('one')); }
/** * Adds a path * * @param string $path * * @return $this */ public function addPath($path) { $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; $this->finder->addPath($path); if ($this->environment) { $this->finder->addPath($path . $this->environment); } return $this; }
protected function addPath(ComponentInterface $component) { $this->finder->addPath($component->getPath()); }
/** * Adds a path that contains asset files * * @param string $path */ public function addPath($path) { $this->finder->addPath($path); }