Overrides Twig_Tests_Node_TestCase::getTests
public function getTests() {
$environment = new Twig_Environment();
$environment
->addFunction('foo', new Twig_Function_Function('foo', array()));
$environment
->addFunction('bar', new Twig_Function_Function('bar', array(
'needs_environment' => true,
)));
$environment
->addFunction('foofoo', new Twig_Function_Function('foofoo', array(
'needs_context' => true,
)));
$environment
->addFunction('foobar', new Twig_Function_Function('foobar', array(
'needs_environment' => true,
'needs_context' => true,
)));
$tests = array();
$node = $this
->createFunction('foo');
$tests[] = array(
$node,
'foo()',
$environment,
);
$node = $this
->createFunction('foo', array(
new Twig_Node_Expression_Constant('bar', 0),
new Twig_Node_Expression_Constant('foobar', 0),
));
$tests[] = array(
$node,
'foo("bar", "foobar")',
$environment,
);
$node = $this
->createFunction('bar');
$tests[] = array(
$node,
'bar($this->env)',
$environment,
);
$node = $this
->createFunction('bar', array(
new Twig_Node_Expression_Constant('bar', 0),
));
$tests[] = array(
$node,
'bar($this->env, "bar")',
$environment,
);
$node = $this
->createFunction('foofoo');
$tests[] = array(
$node,
'foofoo($context)',
$environment,
);
$node = $this
->createFunction('foofoo', array(
new Twig_Node_Expression_Constant('bar', 0),
));
$tests[] = array(
$node,
'foofoo($context, "bar")',
$environment,
);
$node = $this
->createFunction('foobar');
$tests[] = array(
$node,
'foobar($this->env, $context)',
$environment,
);
$node = $this
->createFunction('foobar', array(
new Twig_Node_Expression_Constant('bar', 0),
));
$tests[] = array(
$node,
'foobar($this->env, $context, "bar")',
$environment,
);
return $tests;
}