From: Fabien Potencier Date: Fri, 26 Nov 2010 18:11:59 +0000 (+0100) Subject: fixed a warning and added some unit tests X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=903e3d9860d7fd2eea89b5d49cd19aaf64f912c0;p=web%2Fkonrad%2Ftwig.git fixed a warning and added some unit tests --- diff --git a/test/Twig/Tests/Fixtures/tests/defined.test b/test/Twig/Tests/Fixtures/tests/defined.test index 8ae6808..a401b5e 100644 --- a/test/Twig/Tests/Fixtures/tests/defined.test +++ b/test/Twig/Tests/Fixtures/tests/defined.test @@ -4,9 +4,13 @@ {{ foo is defined ? 'ok' : 'ko' }} {{ bar is defined ? 'ok' : 'ko' }} {{ foobar is not defined ? 'ok' : 'ko' }} +{{ nested.foo is defined ? 'ok' : 'ko' }} +{{ nested.bar is not defined ? 'ok' : 'ko' }} --DATA-- -return array('foo' => 'bar', 'bar' => null); +return array('foo' => 'bar', 'bar' => null, 'nested' => array('foo' => 'foo')); --EXPECT-- ok ok -ok \ No newline at end of file +ok +ok +ok diff --git a/test/Twig/Tests/TemplateTest.php b/test/Twig/Tests/TemplateTest.php index 4e9f4a4..f01c5e9 100644 --- a/test/Twig/Tests/TemplateTest.php +++ b/test/Twig/Tests/TemplateTest.php @@ -73,7 +73,7 @@ class Twig_TemplateTest extends Twig_Template { } - public function getAttribute($object, $item, array $arguments = array(), $type = Twig_Node_Expression_GetAttr::TYPE_ANY) + public function getAttribute($object, $item, array $arguments = array(), $type = Twig_Node_Expression_GetAttr::TYPE_ANY, $noStrictCheck = false) { return parent::getAttribute($object, $item, $arguments, $type); }