20 if (method_exists($this,
'expectException')) {
21 $this->expectException(
'InvalidArgumentException');
22 $this->expectExceptionMessage($expectedExceptionMessage);
24 $this->setExpectedException(
'InvalidArgumentException', $expectedExceptionMessage);
28 $env->addExtension($extension);
29 $env->getUnaryOperators();
36 array(
new InvalidOperatorExtension(array(1, 2, 3)),
'"InvalidOperatorExtension::getOperators()" must return an array of 2 elements, got 3.'),
47 $this->operators = $operators;
86 return $this->operators;
Interface implemented by extension classes.
getFilters()
Returns a list of filters to add to the existing list.
provideInvalidExtensions()
getNodeVisitors()
Returns the node visitor instances to add to the existing list.
getGlobals()
Returns a list of global variables to add to the existing list.
testGetInvalidOperators(Twig_ExtensionInterface $extension, $expectedExceptionMessage)
PHP 5.3 provideInvalidExtensions
getTokenParsers()
Returns the token parser instances to add to the existing list.
getTests()
Returns a list of tests to add to the existing list.
initRuntime(Twig_Environment $environment)
Initializes the runtime environment.
getOperators()
Returns a list of operators to add to the existing list.
Stores the Twig configuration.
getName()
Returns the name of the extension.
getFunctions()
Returns a list of functions to add to the existing list.