PhpSpec\Util\Filesystem::findSpecFilesIn PHP Метод

findSpecFilesIn() публичный Метод

public findSpecFilesIn ( string $path ) : SplFileInfo[]
$path string
Результат SplFileInfo[]
    public function findSpecFilesIn($path)
    {
        $finder = Finder::create()->files()->name('*Spec.php')->followLinks()->sortByName()->in($path);
        return iterator_to_array($finder);
    }

Usage Example

Пример #1
0
 /**
  * @param string $path
  *
  * @return PSR0Resource[]
  */
 protected function findSpecResources($path)
 {
     if (!$this->filesystem->pathExists($path)) {
         return array();
     }
     if ('.php' === substr($path, -4)) {
         return array($this->createResourceFromSpecFile(realpath($path)));
     }
     $resources = array();
     foreach ($this->filesystem->findSpecFilesIn($path) as $file) {
         $resources[] = $this->createResourceFromSpecFile($file->getRealPath());
     }
     return $resources;
 }