From 903e3d9860d7fd2eea89b5d49cd19aaf64f912c0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 26 Nov 2010 19:11:59 +0100 Subject: [PATCH] fixed a warning and added some unit tests --- test/Twig/Tests/Fixtures/tests/defined.test | 8 ++++++-- test/Twig/Tests/TemplateTest.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) 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); } -- 1.7.2.5