From: Fabien Potencier Date: Wed, 31 Oct 2012 12:42:47 +0000 (+0100) Subject: added some unit tests for previous merge X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=c4d5b3ffdb07b2d36ebb52c3b6321bbce6f81037;p=konrad%2Ftwig.git added some unit tests for previous merge --- 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;