public function testExcludeWithNonMatchingPath() { $file = new MockSplFileInfo($this); $file->setReturnValue('getPathname', '/toto/src/db/updates/201004231055_add_system_event_table.php'); $filter = new ForgeUpgrade_BucketFilter(new ArrayIterator(array($file))); $filter->addExclude('/etc/updates/'); $filter->rewind(); $this->assertTrue($filter->valid()); }
/** * Build iterator to find buckets in a file hierarchy * * @param String $dirPath * * @return ForgeUpgrade_BucketFilter */ protected function getBucketFinderIterator($dirPath) { $iter = new RecursiveDirectoryIterator($dirPath); $iter = new RecursiveIteratorIterator($iter, RecursiveIteratorIterator::SELF_FIRST); $iter = new ForgeUpgrade_BucketFilter($iter); $iter->setIncludePaths($this->options['core']['include_path']); $iter->setExcludePaths($this->options['core']['exclude_path']); return $iter; }