public function testMacrosInASandbox() {
$twig = $this
->getEnvironment(true, array(
'autoescape' => true,
), array(
'index' => <<<EOF
{% macro test(text) %}<p>{{ text }}</p>{% endmacro %}
{{ _self.test('username') }}
EOF
,
), array(
'macro',
), array(
'escape',
));
$this
->assertEquals('<p>username</p>', $twig
->loadTemplate('index')
->render(array()));
}