fixed a warning and added some unit tests

This commit is contained in:
Fabien Potencier
2010-11-26 19:11:59 +01:00
parent 3c94b3c033
commit 903e3d9860
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -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
ok
ok
ok
+1 -1
View File
@@ -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);
}