示例#1
0
 public function testGetOverridedTemplateFile()
 {
     $t = new Template($this->container);
     $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'));
 }
示例#2
0
 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'));
 }