You are here

public function Twig_Tests_Extension_SandboxTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php \Twig_Tests_Extension_SandboxTest::setUp()

Sets up the fixture, for example, open a network connection. This method is called before a test is executed.

Overrides PHPUnit_Framework_TestCase::setUp

File

vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php, line 16

Class

Twig_Tests_Extension_SandboxTest

Code

public function setUp() {
  self::$params = array(
    'name' => 'Fabien',
    'obj' => new FooObject(),
    'arr' => array(
      'obj' => new FooObject(),
    ),
  );
  self::$templates = array(
    '1_basic1' => '{{ obj.foo }}',
    '1_basic2' => '{{ name|upper }}',
    '1_basic3' => '{% if name %}foo{% endif %}',
    '1_basic4' => '{{ obj.bar }}',
    '1_basic5' => '{{ obj }}',
    '1_basic6' => '{{ arr.obj }}',
    '1_basic7' => '{{ cycle(["foo","bar"], 1) }}',
    '1_basic8' => '{{ obj.getfoobar }}{{ obj.getFooBar }}',
    '1_basic9' => '{{ obj.foobar }}{{ obj.fooBar }}',
    '1_basic' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}',
    '1_layout' => '{% block content %}{% endblock %}',
    '1_child' => "{% extends \"1_layout\" %}\n{% block content %}\n{{ \"a\"|json_encode }}\n{% endblock %}",
  );
}