mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-20 14:36:57 +00:00
fixed a PHP notice when trying to access a key on a non-object/array variable
This commit is contained in:
@@ -10,6 +10,20 @@
|
||||
*/
|
||||
class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException Twig_Error_Runtime
|
||||
* @expectedExceptionMessage Impossible to access a key ("a") on a "string" variable
|
||||
*/
|
||||
public function testAttributeOnAString()
|
||||
{
|
||||
$template = new Twig_TemplateTest(
|
||||
new Twig_Environment(null, array('strict_variables' => true)),
|
||||
false
|
||||
);
|
||||
|
||||
$template->getAttribute('string', 'a', array(), Twig_TemplateInterface::ARRAY_CALL, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getGetAttributeTests
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user