update php resource tests

This commit is contained in:
uwetews
2016-03-10 20:56:33 +01:00
parent 531df47a97
commit d744c408fe
2 changed files with 21 additions and 19 deletions

View File

@@ -76,25 +76,7 @@ class PhpResourceTest extends PHPUnit_Smarty
$tpl = $this->smarty->createTemplate('php:phphelloworld.php'); $tpl = $this->smarty->createTemplate('php:phphelloworld.php');
$this->assertFalse($tpl->source->handler->recompiled); $this->assertFalse($tpl->source->handler->recompiled);
} }
/**
* test getCompiledFilepath
*/
public function testGetCompiledFilepath()
{
$tpl = $this->smarty->createTemplate('php:phphelloworld.php');
$this->assertFalse($tpl->compiled->filepath);
}
/**
* test getCompiledTimestamp
*/
public function testGetCompiledTimestamp()
{
$tpl = $this->smarty->createTemplate('php:phphelloworld.php');
$this->assertFalse($tpl->compiled->getTimeStamp());
}
/** /**
* test mustCompile * test mustCompile
*/ */
@@ -284,4 +266,23 @@ class PhpResourceTest extends PHPUnit_Smarty
$expected = $this->buildCachedPath($tpl, false, null, null, 'helloworld.php', 'php', $this->smarty->getTemplateDir('foo'), 'file'); $expected = $this->buildCachedPath($tpl, false, null, null, 'helloworld.php', 'php', $this->smarty->getTemplateDir('foo'), 'file');
$this->assertEquals($expected, $path); $this->assertEquals($expected, $path);
} }
/**
* test getRenderedTemplate
*/
public function testIncludePhpTemplate()
{
$this->smarty->setAllowPhpTemplates(true);
$this->assertContains('php hello world', $this->smarty->fetch('includephp.tpl'));
}
/**
* test getRenderedTemplate
*/
public function testIncludePhpTemplateCaching()
{
$this->smarty->caching = true;
$this->smarty->setAllowPhpTemplates(true);
$this->assertContains('php hello world', $this->smarty->fetch('includephp.tpl'));
}
} }

View File

@@ -0,0 +1 @@
{include 'php:phphelloworld.php'}