mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-07-17 16:39:40 +00:00
Unit test on escaping the template directory
This commit is contained in:
parent
591d2d40e1
commit
5f6c2beb3b
1 changed files with 4 additions and 0 deletions
|
|
@ -41,6 +41,7 @@ class TemplateSwitcherTest extends TestCase
|
|||
$defaultTemplateFallback = 'bootstrap5';
|
||||
$customTemplate = 'bootstrap-dark';
|
||||
$customWrongTemplate = 'bootstrap-wrong';
|
||||
$escapeTemplateDirectory = '../index';
|
||||
|
||||
TemplateSwitcher::setTemplateFallback($defaultTemplateFallback);
|
||||
|
||||
|
|
@ -49,6 +50,9 @@ class TemplateSwitcherTest extends TestCase
|
|||
|
||||
$_COOKIE['template'] = $customTemplate;
|
||||
$this->assertEquals($customTemplate, TemplateSwitcher::getTemplate(), 'Custom template');
|
||||
|
||||
$_COOKIE['template'] = $escapeTemplateDirectory;
|
||||
$this->assertEquals($defaultTemplateFallback, TemplateSwitcher::getTemplate(), 'Fallback on escaping template directory');
|
||||
}
|
||||
|
||||
public function testGetAvailableTemplates()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue