35 return dirname(__FILE__).
'/Fixtures/';
46 const BAR_NAME =
'bar';
51 public function bar($param1 = null, $param2 = null)
53 return 'bar'.($param1 ?
'_'.$param1 :
'').($param2 ?
'-'.$param2 :
'');
83 return strtolower($value);
93 return $this->
array[$this->position];
108 return isset($this->
array[$this->position]);
147 new Twig_SimpleFilter(
'magic_call_string',
'TwigTestExtension::magicStaticCall'),
189 return $this->nl2br(twig_escape_filter(
$env, $value,
'html'), $sep);
195 public function nl2br($value, $sep =
'<br />')
199 return str_replace(
"\n",
"$sep\n", $value);
204 return $element.
'/'.$item;
209 return $foo.
'/'.$bar.
'/'.$item;
214 return strtoupper($value);
219 return strtoupper($value);
234 return false !== strpos($value,
' ');
237 public function __call($method, $arguments)
239 if (
'magicCall' !== $method) {
243 return 'magic_'.$arguments[0];
248 if (
'magicStaticCall' !== $method) {
252 return 'static_magic_'.$arguments[0];
264 throw new Exception(
'__call shall not be called');
277 $this->
string = $string;
282 return $this->string;
297 $this->count = $count;
307 throw new Exception(
'__toString shall not be called on \Countables');
getTag()
Gets the tag name associated with this token parser.
Represents a template function.
static __callStatic($method, $arguments)
getFunctions()
Returns a list of functions to add to the existing list.
bar($param1=null, $param2=null)
getTokenParsers()
Returns the token parser instances to add to the existing list.
__call($method, $arguments)
escape_and_nl2br($env, $value, $sep='< br/>')
nl2br which also escapes, for testing escaper filters.
dynamic_path($element, $item)
Represents a template filter.
Represents a node that outputs an expression.
Base class for all token parsers.
getTests()
Returns a list of tests to add to the existing list.
This class is used in tests for the length filter and empty test to show that when is implemented...
static staticCall($value)
This class is used in tests for the length filter.
nl2br($value, $sep='< br/>')
nl2br only, for testing filters with pre_escape.
Create styles array
The data for the language used.
parse(Twig_Token $token)
Parses a token and returns a node.
Represents a security policy which need to be enforced when sandbox mode is enabled.
Represents a template test.
dynamic_foo($foo, $bar, $item)
getFilters()
Returns a list of filters to add to the existing list.
This class is used in tests for the "length" filter and "empty" test.