{
$twig = new Twig_Environment(new Twig_Loader_String());
$twig->addExtension(new Twig_Tests_EnvironmentTest_Extension());
- $twig->removeExtension('test');
+ $twig->removeExtension('environment_test');
$this->assertFalse(array_key_exists('test', $twig->getTags()));
$this->assertFalse(array_key_exists('foo_filter', $twig->getFilters()));
public function getName()
{
- return 'test';
+ return 'environment_test';
}
}
}
}
-class TwigTestTokenParser_☃ extends Twig_TokenParser
+class TwigTestTokenParser_§ extends Twig_TokenParser
{
public function parse(Twig_Token $token)
{
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
- return new Twig_Node_Print(new Twig_Node_Expression_Constant('☃', -1), -1);
+ return new Twig_Node_Print(new Twig_Node_Expression_Constant('§', -1), -1);
}
public function getTag()
{
- return '☃';
+ return '§';
}
}
public function getTokenParsers()
{
return array(
- new TwigTestTokenParser_☃(),
+ new TwigTestTokenParser_§(),
);
}
public function getFilters()
{
return array(
- '☃' => new Twig_Filter_Method($this, '☃Filter'),
+ '§' => new Twig_Filter_Method($this, '§Filter'),
'escape_and_nl2br' => new Twig_Filter_Method($this, 'escape_and_nl2br', array('needs_environment' => true, 'is_safe' => array('html'))),
'nl2br' => new Twig_Filter_Method($this, 'nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))),
'escape_something' => new Twig_Filter_Method($this, 'escape_something', array('is_safe' => array('something'))),
public function getFunctions()
{
return array(
- '☃' => new Twig_Function_Method($this, '☃Function'),
+ '§' => new Twig_Function_Method($this, '§Function'),
'safe_br' => new Twig_Function_Method($this, 'br', array('is_safe' => array('html'))),
'unsafe_br' => new Twig_Function_Method($this, 'br'),
'*_path' => new Twig_Function_Method($this, 'dynamic_path'),
);
}
- public function ☃Filter($value)
+ public function §Filter($value)
{
- return "☃{$value}☃";
+ return "§{$value}§";
}
- public function ☃Function($value)
+ public function §Function($value)
{
- return "☃{$value}☃";
+ return "§{$value}§";
}
/**
public function getName()
{
- return 'test';
+ return 'integration_test';
}
}
{
public function testNameLabelForTag()
{
- $template = '{% ☃ %}';
+ $template = '{% § %}';
$lexer = new Twig_Lexer(new Twig_Environment());
$stream = $lexer->tokenize($template);
$stream->expect(Twig_Token::BLOCK_START_TYPE);
- $this->assertSame('☃', $stream->expect(Twig_Token::NAME_TYPE)->getValue());
+ $this->assertSame('§', $stream->expect(Twig_Token::NAME_TYPE)->getValue());
}
public function testNameLabelForFunction()
{
- $template = '{{ ☃() }}';
+ $template = '{{ §() }}';
$lexer = new Twig_Lexer(new Twig_Environment());
$stream = $lexer->tokenize($template);
$stream->expect(Twig_Token::VAR_START_TYPE);
- $this->assertSame('☃', $stream->expect(Twig_Token::NAME_TYPE)->getValue());
+ $this->assertSame('§', $stream->expect(Twig_Token::NAME_TYPE)->getValue());
}
public function testBracketsNesting()