/** * @param $xmlFileName * @return \SimpleXMLElement */ private function importFile($xmlFileName) { $config = []; if (File::fileExists($xmlFileName)) { $config = simplexml_load_file($xmlFileName); return $config; } return $config; }
/** * @param $controller * @param Directory $directory * @return mixed */ private static function findControllerFilename($controller, Directory $directory) { $fileName = ''; foreach ($directory->getArray() as $_file) { if (File::fileExists($_file) && preg_match('/^.*' . $controller . 'Controller.php$/', $_file)) { $fileName = $_file; break; } } return $fileName; }
/** * @param $file * @throws FileNotFoundException */ private function checkViewExists($file) { if (!File::fileExists($file)) { throw new FileNotFoundException(); } }
/** * */ public function testFileExistsWithNotExistingFile() { $this->assertFalse(File::fileExists(__DIR__ . '/../resources/notExisting.txt')); }