public function testThatCustomFinderWorks() { $finder = Finder::create(); $finder->in(__DIR__ . '/Fixtures/FinderDirectory'); $config = Config::create()->finder($finder); $iterator = $config->getFinder()->getIterator(); $this->assertSame(1, count($iterator)); $iterator->rewind(); $this->assertSame('somefile.php', $iterator->current()->getFilename()); }
/** * @expectedException \LogicException * @expectedExceptionMessageRegExp /^You must call (?:the in\(\) method)|(?:one of in\(\) or append\(\)) methods before iterating over a Finder\.$/ */ public function testThatDefaultFinderDoesNotSpecifyAnyDirectory() { $finder = Finder::create(); $finder->getIterator(); }