/** * Returns true if it is a valid template * * @param string $templatePath * @return boolean */ public function validTemplate($templatePath) { if (!is_dir($templatePath)) { return false; } $template = new Template(); $template->setPath($templatePath); return $template->isValid(); }
public function testIsValidWithNonExistantMainFile() { $template = new Template(); $path = $this->getExampleTemplatePath(); $template->setPath($path); $name = 'example-template'; $template->setName($name); $newName = $path . DIRECTORY_SEPARATOR . \ColumnisTest\Bootstrap::getRandString(); rename($template->getMainFile(), $newName); $this->assertFalse($template->isValid()); rename($newName, $template->getMainFile()); }