diff options
Diffstat (limited to 'tests/units/Core/TemplateTest.php')
-rw-r--r-- | tests/units/Core/TemplateTest.php | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/tests/units/Core/TemplateTest.php b/tests/units/Core/TemplateTest.php index 19c0da1a..6e5ae00d 100644 --- a/tests/units/Core/TemplateTest.php +++ b/tests/units/Core/TemplateTest.php @@ -9,20 +9,34 @@ class TemplateTest extends Base public function testGetTemplateFile() { $t = new Template($this->container); - $this->assertStringEndsWith('app/Core/../Template/a/b.php', $t->getTemplateFile('a/b')); + $this->assertStringEndsWith( + 'app'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Template'.DIRECTORY_SEPARATOR.'a'.DIRECTORY_SEPARATOR.'b.php', + $t->getTemplateFile('a'.DIRECTORY_SEPARATOR.'b') + ); } public function testGetPluginTemplateFile() { $t = new Template($this->container); - $this->assertStringEndsWith('app/Core/../../plugins/Myplugin/Template/a/b.php', $t->getTemplateFile('myplugin:a/b')); + $this->assertStringEndsWith( + 'app'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'Myplugin'.DIRECTORY_SEPARATOR.'Template'.DIRECTORY_SEPARATOR.'a'.DIRECTORY_SEPARATOR.'b.php', + $t->getTemplateFile('myplugin:a'.DIRECTORY_SEPARATOR.'b') + ); } public function testGetOverridedTemplateFile() { $t = new Template($this->container); - $t->setTemplateOverride('a/b', 'myplugin:c'); - $this->assertStringEndsWith('app/Core/../../plugins/Myplugin/Template/c.php', $t->getTemplateFile('a/b')); - $this->assertStringEndsWith('app/Core/../Template/d.php', $t->getTemplateFile('d')); + $t->setTemplateOverride('a'.DIRECTORY_SEPARATOR.'b', 'myplugin:c'); + + $this->assertStringEndsWith( + 'app'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'Myplugin'.DIRECTORY_SEPARATOR.'Template'.DIRECTORY_SEPARATOR.'c.php', + $t->getTemplateFile('a'.DIRECTORY_SEPARATOR.'b') + ); + + $this->assertStringEndsWith( + 'app'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Template'.DIRECTORY_SEPARATOR.'d.php', + $t->getTemplateFile('d') + ); } } |