/** * Adds all the files in a directory to the test suite. Does not recursive through directories. * * @param string $directory The directory to add tests from. * @return void */ public function addTestDirectory($directory = '.') { $Folder = new Folder($directory); list(, $files) = $Folder->read(true, true, true); foreach ($files as $file) { if (substr($file, -4) === '.php') { $this->addTestFile($file); } } }
/** * Scan a directory for .php files and return the class names that * should be within them. * * @param string $dir The directory to read. * @return array The list of shell classnames based on conventions. */ protected function _scanDir($dir) { $dir = new Folder($dir); $contents = $dir->read(true, true); if (empty($contents[1])) { return []; } $shells = []; foreach ($contents[1] as $file) { if (substr($file, -4) !== '.php') { continue; } $shells[] = substr($file, 0, -4); } return $shells; }