From: Fabien Potencier Date: Wed, 1 May 2013 18:32:42 +0000 (+0200) Subject: changed ☃ to § in tests (closes #996) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=c8fe25389031c2009ad5797b397518d87c77dbf1;p=konrad%2Ftwig.git changed ☃ to § in tests (closes #996) --- diff --git a/CHANGELOG b/CHANGELOG index da7ac75..2b8a4cf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ * 1.13.0 (2013-XX-XX) + * changed ☃ to § in tests * enforced usage of named arguments after positional ones * 1.12.3 (2013-04-08) diff --git a/test/Twig/Tests/EnvironmentTest.php b/test/Twig/Tests/EnvironmentTest.php index 664e980..22461b5 100644 --- a/test/Twig/Tests/EnvironmentTest.php +++ b/test/Twig/Tests/EnvironmentTest.php @@ -186,7 +186,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase { $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())); @@ -253,7 +253,7 @@ class Twig_Tests_EnvironmentTest_Extension extends Twig_Extension public function getName() { - return 'test'; + return 'environment_test'; } } diff --git a/test/Twig/Tests/Fixtures/filters/special_chars.test b/test/Twig/Tests/Fixtures/filters/special_chars.test index cc91900..dbaf7dc 100644 --- a/test/Twig/Tests/Fixtures/filters/special_chars.test +++ b/test/Twig/Tests/Fixtures/filters/special_chars.test @@ -1,8 +1,8 @@ --TEST-- -"☃" custom filter +"§" custom filter --TEMPLATE-- -{{ 'foo'|☃ }} +{{ 'foo'|§ }} --DATA-- return array() --EXPECT-- -☃foo☃ +§foo§ diff --git a/test/Twig/Tests/Fixtures/functions/special_chars.test b/test/Twig/Tests/Fixtures/functions/special_chars.test index f602b0d..30c3df5 100644 --- a/test/Twig/Tests/Fixtures/functions/special_chars.test +++ b/test/Twig/Tests/Fixtures/functions/special_chars.test @@ -1,8 +1,8 @@ --TEST-- -"☃" custom function +"§" custom function --TEMPLATE-- -{{ ☃('foo') }} +{{ §('foo') }} --DATA-- return array() --EXPECT-- -☃foo☃ +§foo§ diff --git a/test/Twig/Tests/Fixtures/tags/block/special_chars.test b/test/Twig/Tests/Fixtures/tags/block/special_chars.test index 441570c..be17fed 100644 --- a/test/Twig/Tests/Fixtures/tags/block/special_chars.test +++ b/test/Twig/Tests/Fixtures/tags/block/special_chars.test @@ -1,10 +1,10 @@ --TEST-- -"☃" special chars in a block name +"§" special chars in a block name --TEMPLATE-- -{% block ☃ %} -☃ -{% endblock ☃ %} +{% block § %} +§ +{% endblock § %} --DATA-- return array() --EXPECT-- -☃ +§ diff --git a/test/Twig/Tests/Fixtures/tags/macro/special_chars.test b/test/Twig/Tests/Fixtures/tags/macro/special_chars.test index 0999951..3721770 100644 --- a/test/Twig/Tests/Fixtures/tags/macro/special_chars.test +++ b/test/Twig/Tests/Fixtures/tags/macro/special_chars.test @@ -1,14 +1,14 @@ --TEST-- -"☃" as a macro name +"§" as a macro name --TEMPLATE-- {% import _self as macros %} -{{ macros.☃('foo') }} +{{ macros.§('foo') }} -{% macro ☃(foo) %} - ☃{{ foo }}☃ +{% macro §(foo) %} + §{{ foo }}§ {% endmacro %} --DATA-- return array() --EXPECT-- -☃foo☃ +§foo§ diff --git a/test/Twig/Tests/Fixtures/tags/special_chars.test b/test/Twig/Tests/Fixtures/tags/special_chars.test index d584d9e..789b4ba 100644 --- a/test/Twig/Tests/Fixtures/tags/special_chars.test +++ b/test/Twig/Tests/Fixtures/tags/special_chars.test @@ -1,8 +1,8 @@ --TEST-- -"☃" custom tag +"§" custom tag --TEMPLATE-- -{% ☃ %} +{% § %} --DATA-- return array() --EXPECT-- -☃ +§ diff --git a/test/Twig/Tests/IntegrationTest.php b/test/Twig/Tests/IntegrationTest.php index 3b053cd..5feb8f4 100644 --- a/test/Twig/Tests/IntegrationTest.php +++ b/test/Twig/Tests/IntegrationTest.php @@ -109,18 +109,18 @@ class TwigTestFoo implements Iterator } } -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 '§'; } } @@ -129,14 +129,14 @@ class TwigTestExtension extends Twig_Extension 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'))), @@ -149,7 +149,7 @@ class TwigTestExtension extends Twig_Extension 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'), @@ -157,14 +157,14 @@ class TwigTestExtension extends Twig_Extension ); } - public function ☃Filter($value) + public function §Filter($value) { - return "☃{$value}☃"; + return "§{$value}§"; } - public function ☃Function($value) + public function §Function($value) { - return "☃{$value}☃"; + return "§{$value}§"; } /** @@ -212,6 +212,6 @@ class TwigTestExtension extends Twig_Extension public function getName() { - return 'test'; + return 'integration_test'; } } diff --git a/test/Twig/Tests/LexerTest.php b/test/Twig/Tests/LexerTest.php index 34ed74f..9f3c751 100644 --- a/test/Twig/Tests/LexerTest.php +++ b/test/Twig/Tests/LexerTest.php @@ -12,24 +12,24 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase { 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()