diff --git a/core/lib/Drupal/Core/Template/TwigNodeExpressionFunction.php b/core/lib/Drupal/Core/Template/TwigNodeExpressionFunction.php index 0e3f9b4..9d5e295 100644 --- a/core/lib/Drupal/Core/Template/TwigNodeExpressionFunction.php +++ b/core/lib/Drupal/Core/Template/TwigNodeExpressionFunction.php @@ -28,7 +28,7 @@ class TwigNodeExpressionFunction extends \Twig_Node_Expression_Function { /** * {@inheritdoc} */ - public function __construct($name, \Twig_NodeInterface $arguments, $extra_arguments, $lineno) { + public function __construct($name, \Twig_NodeInterface $arguments, $lineno, array $extra_arguments) { parent::__construct($name, $arguments, $lineno); $this->extra_arguments = $extra_arguments; } diff --git a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php index d4095a4..df756c1 100644 --- a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php +++ b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php @@ -41,7 +41,7 @@ function leaveNode(\Twig_NodeInterface $node, \Twig_Environment $env) { $line = $node->getLine(); $name = $node->getNode('expr')->hasAttribute('name') ? $node->getNode('expr')->getAttribute('name') : 'Object'; return new $class( - new TwigNodeExpressionFunction('render_var', new \Twig_Node(array($node->getNode('expr'))), array($name), $line), + new TwigNodeExpressionFunction('render_var', new \Twig_Node(array($node->getNode('expr'))), $line, array($name)), $line ); } diff --git a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php index 55dd4de..0364d6a 100644 --- a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php +++ b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php @@ -128,6 +128,7 @@ public function testChainAddRemoveClasses() { /** * Tests the twig calls to the Attribute. + * * @dataProvider providerTestAttributeClassHelpers * * @covers ::removeClass() @@ -232,6 +233,7 @@ public function testStorage() { * Provides test data sets for testCreateAttributeValue(). * * @see $this->testCreateAttributeValue() + * * @return array */ public function createAttributeValuesProvider() { @@ -287,6 +289,7 @@ public function createAttributeValuesProvider() { /** * @covers ::createAttributeValue() + * * @dataProvider createAttributeValuesProvider */ public function testCreateAttributeValue($name, $value, $result) { @@ -298,11 +301,13 @@ public function testCreateAttributeValue($name, $value, $result) { /** * @covers ::createAttributeValue() + * * @expectedException \Exception + * @expectedExceptionMessage "Random string !@#$" attribute value of type "stdClass" can not be converted to string */ public function testCreateAttributeValueException() { $attribute = new Attribute(); - $name = $this->getRandomGenerator()->string(); + $name = 'Random string !@#$'; $value = $this->getRandomGenerator()->object(); $createAttributeValueMethod = $this->getCreateAttributeValueMethod();