/**
  * @dataProvider existsProvider
  */
 public function testExists($file, $expected)
 {
     $resource = new DirectoryResource($file, new DirectoryResourceConfiguration());
     $this->assertSame($expected, $resource->exists());
 }
 /**
  * Finds files by a DirectoryResource.
  *
  * @param DirectoryResource $resource
  * @param array             $excludes
  *
  * @return Finder
  */
 protected function findFiles(DirectoryResource $resource, $excludes = array())
 {
     $finder = Finder::create()->files()->filter(function (\SplFileInfo $file) use($excludes) {
         foreach ($excludes as $exclude) {
             if (strpos($file->getRealPath(), $exclude) !== false) {
                 return false;
             }
         }
         return true;
     })->in((array) $resource->getResource())->sortByName();
     return $finder;
 }