You are here

public function Twig_Tests_ExpressionParserTest::getTestsForString in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php \Twig_Tests_ExpressionParserTest::getTestsForString()

File

vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php, line 171

Class

Twig_Tests_ExpressionParserTest

Code

public function getTestsForString() {
  return array(
    array(
      '{{ "foo" }}',
      new Twig_Node_Expression_Constant('foo', 1),
    ),
    array(
      '{{ "foo #{bar}" }}',
      new Twig_Node_Expression_Binary_Concat(new Twig_Node_Expression_Constant('foo ', 1), new Twig_Node_Expression_Name('bar', 1), 1),
    ),
    array(
      '{{ "foo #{bar} baz" }}',
      new Twig_Node_Expression_Binary_Concat(new Twig_Node_Expression_Binary_Concat(new Twig_Node_Expression_Constant('foo ', 1), new Twig_Node_Expression_Name('bar', 1), 1), new Twig_Node_Expression_Constant(' baz', 1), 1),
    ),
    array(
      '{{ "foo #{"foo #{bar} baz"} baz" }}',
      new Twig_Node_Expression_Binary_Concat(new Twig_Node_Expression_Binary_Concat(new Twig_Node_Expression_Constant('foo ', 1), new Twig_Node_Expression_Binary_Concat(new Twig_Node_Expression_Binary_Concat(new Twig_Node_Expression_Constant('foo ', 1), new Twig_Node_Expression_Name('bar', 1), 1), new Twig_Node_Expression_Constant(' baz', 1), 1), 1), new Twig_Node_Expression_Constant(' baz', 1), 1),
    ),
  );
}