@dataProvider getGetAttributeTests
public function testGetAttributeStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false, $exceptionMessage = null) {
$template = new Twig_TemplateTest(new Twig_Environment(null, array(
'strict_variables' => true,
)), $useExt);
if ($defined) {
$this
->assertEquals($value, $template
->getAttribute($object, $item, $arguments, $type));
}
else {
try {
$this
->assertEquals($value, $template
->getAttribute($object, $item, $arguments, $type));
throw new Exception('Expected Twig_Error_Runtime exception.');
} catch (Twig_Error_Runtime $e) {
if (null !== $exceptionMessage) {
$this
->assertSame($exceptionMessage, $e
->getMessage());
}
}
}
}