mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-26 22:56:27 -04:00
Fix error when a custom template is not in the default available templates list
This commit is contained in:
@@ -142,4 +142,20 @@ class ViewTest extends TestCase
|
||||
$this->expectExceptionCode(80);
|
||||
$test->draw('123456789 does not exist!');
|
||||
}
|
||||
|
||||
public function testTemplateFilePath()
|
||||
{
|
||||
$template = 'bootstrap';
|
||||
$templatePath = PATH . 'tpl' . DIRECTORY_SEPARATOR . $template . '.php';
|
||||
$path = View::getTemplateFilePath($template);
|
||||
$this->assertEquals($templatePath, $path, 'Template file path');
|
||||
}
|
||||
|
||||
public function testIsBootstrapTemplate()
|
||||
{
|
||||
$bootstrapTemplate = 'bootstrap-dark';
|
||||
$nonBootstrapTemplate = 'page';
|
||||
$this->assertTrue(View::isBootstrapTemplate($bootstrapTemplate), 'Is bootstrap template');
|
||||
$this->assertFalse(View::isBootstrapTemplate($nonBootstrapTemplate), 'Is not bootstrap template');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user