You are here

public function Twig_Tests_ErrorTest::getErroredTemplates in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/test/Twig/Tests/ErrorTest.php \Twig_Tests_ErrorTest::getErroredTemplates()

File

vendor/twig/twig/test/Twig/Tests/ErrorTest.php, line 88

Class

Twig_Tests_ErrorTest

Code

public function getErroredTemplates() {
  return array(
    // error occurs in a template
    array(
      array(
        'index' => "\n\n{{ foo.bar }}\n\n\n{{ 'foo' }}",
      ),
      'index',
      3,
    ),
    // error occurs in an included template
    array(
      array(
        'index' => "{% include 'partial' %}",
        'partial' => '{{ foo.bar }}',
      ),
      'partial',
      1,
    ),
    // error occurs in a parent block when called via parent()
    array(
      array(
        'index' => "{% extends 'base' %}\n                    {% block content %}\n                        {{ parent() }}\n                    {% endblock %}",
        'base' => '{% block content %}{{ foo.bar }}{% endblock %}',
      ),
      'base',
      1,
    ),
    // error occurs in a block from the child
    array(
      array(
        'index' => "{% extends 'base' %}\n                    {% block content %}\n                        {{ foo.bar }}\n                    {% endblock %}\n                    {% block foo %}\n                        {{ foo.bar }}\n                    {% endblock %}",
        'base' => '{% block content %}{% endblock %}',
      ),
      'index',
      3,
    ),
  );
}