From c4d5b3ffdb07b2d36ebb52c3b6321bbce6f81037 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 31 Oct 2012 13:42:47 +0100 Subject: [PATCH] added some unit tests for previous merge --- test/Twig/Tests/TemplateTest.php | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/test/Twig/Tests/TemplateTest.php b/test/Twig/Tests/TemplateTest.php index 7b821dc..014e036 100644 --- a/test/Twig/Tests/TemplateTest.php +++ b/test/Twig/Tests/TemplateTest.php @@ -199,6 +199,8 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase 'null' => null, '1' => 1, 'bar' => true, + '09' => '09', + '+4' => '+4', ); $objectArray = new Twig_TemplateArrayAccessObject(); @@ -224,6 +226,8 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase array(true, 1, 1.0), array(true, null, 'null'), array(true, true, 'bar'), + array(true, '09', '09'), + array(true, '+4', '+4'), ); $testObjects = array( // array(object, type of fetch) @@ -243,6 +247,10 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase foreach ($basicTests as $test) { // properties cannot be numbers if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) { + continue; + } + + if ('+4' === $test[2] && $methodObject === $testObject[0]) { continue; } @@ -380,6 +388,8 @@ class Twig_TemplateArrayAccessObject implements ArrayAccess 'null' => null, '1' => 1, 'bar' => true, + '09' => '09', + '+4' => '+4', ); public function offsetExists($name) @@ -410,6 +420,8 @@ class Twig_TemplateMagicPropertyObject 'null' => null, '1' => 1, 'bar' => true, + '09' => '09', + '+4' => '+4', ); protected $protected = 'protected'; @@ -478,6 +490,11 @@ class Twig_TemplateMethodObject return 1; } + public function get09() + { + return '09'; + } + public function getZero() { return 0; -- 1.7.2.5