This commit is contained in:
Fabien Potencier
2013-09-19 13:52:03 +02:00
parent 0d97eb9528
commit 00ecabf1b0
4 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class Twig_Tests_CompilerTest extends PHPUnit_Framework_TestCase
$required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252');
if (false === setlocale(LC_NUMERIC, $required_locales)) {
$this->markTestSkipped('Could not set any of required locales: ' . implode(", ", $required_locales));
$this->markTestSkipped('Could not set any of required locales: '.implode(", ", $required_locales));
}
$this->assertEquals('1.2', $compiler->repr(1.2)->getSource());
+8 -8
View File
@@ -62,11 +62,11 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase
public function testLineDirective()
{
$template = "foo\n"
. "bar\n"
. "{% line 10 %}\n"
. "{{\n"
. "baz\n"
. "}}\n";
."bar\n"
."{% line 10 %}\n"
."{{\n"
."baz\n"
."}}\n";
$lexer = new Twig_Lexer(new Twig_Environment());
$stream = $lexer->tokenize($template);
@@ -84,9 +84,9 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase
public function testLineDirectiveInline()
{
$template = "foo\n"
. "bar{% line 10 %}{{\n"
. "baz\n"
. "}}\n";
."bar{% line 10 %}{{\n"
."baz\n"
."}}\n";
$lexer = new Twig_Lexer(new Twig_Environment());
$stream = $lexer->tokenize($template);
+1 -1
View File
@@ -24,6 +24,6 @@ class Twig_Tests_NativeExtensionTest extends PHPUnit_Framework_TestCase
$output = $twig->render('{{ d1.date }}{{ d2.date }}', compact('d1', 'd2'));
// If it fails, PHP will crash.
$this->assertEquals($output, $d1->date . $d2->date);
$this->assertEquals($output, $d1->date.$d2->date);
}
}
+6 -6
View File
@@ -237,18 +237,18 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
}
if ($codepoint < 0x800) {
return chr($codepoint >> 6 & 0x3f | 0xc0)
. chr($codepoint & 0x3f | 0x80);
.chr($codepoint & 0x3f | 0x80);
}
if ($codepoint < 0x10000) {
return chr($codepoint >> 12 & 0x0f | 0xe0)
. chr($codepoint >> 6 & 0x3f | 0x80)
. chr($codepoint & 0x3f | 0x80);
.chr($codepoint >> 6 & 0x3f | 0x80)
.chr($codepoint & 0x3f | 0x80);
}
if ($codepoint < 0x110000) {
return chr($codepoint >> 18 & 0x07 | 0xf0)
. chr($codepoint >> 12 & 0x3f | 0x80)
. chr($codepoint >> 6 & 0x3f | 0x80)
. chr($codepoint & 0x3f | 0x80);
.chr($codepoint >> 12 & 0x3f | 0x80)
.chr($codepoint >> 6 & 0x3f | 0x80)
.chr($codepoint & 0x3f | 0x80);
}
throw new Exception('Codepoint requested outside of Unicode range');
}