summaryrefslogtreecommitdiff
path: root/tests/units/Core/TemplateTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-22 21:31:30 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-22 21:31:30 -0400
commit9707c0b4c4145b9fbdab3a2ecb40c92633dacab1 (patch)
tree126918a559d09d5e1bda51f5baf520e399c3c10f /tests/units/Core/TemplateTest.php
parent5d1507522366e51be79813fd5a0c80e96001a964 (diff)
Make unit tests pass under Windows
Diffstat (limited to 'tests/units/Core/TemplateTest.php')
-rw-r--r--tests/units/Core/TemplateTest.php24
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')
+ );
}
}