mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-17 12:57:05 +00:00
added a missing test
This commit is contained in:
@@ -115,8 +115,13 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'string'));
|
$this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'string'));
|
||||||
$this->assertEquals('some_string', $template->getAttribute($template1, 'string'));
|
$this->assertEquals('some_string', $template->getAttribute($template1, 'string'));
|
||||||
|
|
||||||
$this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'true'));
|
$this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'true'));
|
||||||
$this->assertEquals('1', $template->getAttribute($template1, 'true'));
|
$this->assertEquals('1', $template->getAttribute($template1, 'true'));
|
||||||
|
|
||||||
|
$this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'zero'));
|
||||||
|
$this->assertEquals('0', $template->getAttribute($template1, 'zero'));
|
||||||
|
|
||||||
$this->assertNotInstanceof('Twig_Markup', $template->getAttribute($template1, 'empty'));
|
$this->assertNotInstanceof('Twig_Markup', $template->getAttribute($template1, 'empty'));
|
||||||
$this->assertSame('', $template->getAttribute($template1, 'empty'));
|
$this->assertSame('', $template->getAttribute($template1, 'empty'));
|
||||||
}
|
}
|
||||||
@@ -318,6 +323,11 @@ class Twig_TemplateTest extends Twig_Template
|
|||||||
Twig_Template::clearCache();
|
Twig_Template::clearCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getZero()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
public function getEmpty()
|
public function getEmpty()
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
Reference in New Issue
Block a user