This commit is contained in:
Fabien Potencier
2015-01-20 14:45:25 +01:00
parent dff81dc846
commit 89df3c20ef
5 changed files with 12 additions and 13 deletions
+2 -2
View File
@@ -112,7 +112,7 @@ class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase
{% block content %}
{{ parent() }}
{% endblock %}",
'base' => '{% block content %}{{ foo.bar }}{% endblock %}'
'base' => '{% block content %}{{ foo.bar }}{% endblock %}',
),
'base', 1,
),
@@ -127,7 +127,7 @@ class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase
{% block foo %}
{{ foo.bar }}
{% endblock %}",
'base' => '{% block content %}{% endblock %}'
'base' => '{% block content %}{% endblock %}',
),
'index', 3,
),
+2 -2
View File
@@ -32,7 +32,7 @@ class Twig_Tests_ExpressionParserTest extends PHPUnit_Framework_TestCase
array('{% set 3 = "foo" %}'),
array('{% set 1 + 2 = "foo" %}'),
array('{% set "bar" = "foo" %}'),
array('{% set %}{% endset %}')
array('{% set %}{% endset %}'),
);
}
@@ -190,7 +190,7 @@ class Twig_Tests_ExpressionParserTest extends PHPUnit_Framework_TestCase
),
new Twig_Node_Expression_Constant(' baz', 1),
1
)
),
),
array(
+1 -1
View File
@@ -20,7 +20,7 @@ class Twig_Tests_NativeExtensionTest extends PHPUnit_Framework_TestCase
$twig = new Twig_Environment(new Twig_Loader_String(), array(
'debug' => true,
'cache' => false,
'autoescape' => false
'autoescape' => false,
));
$d1 = new DateTime();
+2 -2
View File
@@ -310,7 +310,7 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
foreach ($basicTests as $test) {
// properties cannot be numbers
if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) {
continue;
continue;
}
if ('+4' === $test[2] && $methodObject === $testObject[0]) {
@@ -347,7 +347,7 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
}
}
$methodAndPropObject = new Twig_TemplateMethodAndPropObject;
$methodAndPropObject = new Twig_TemplateMethodAndPropObject();
// additional method tests
$tests = array_merge($tests, array(
+5 -6
View File
@@ -6,7 +6,6 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
{
/**
@@ -17,7 +16,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
'"' => '"',
'<' => '&lt;',
'>' => '&gt;',
'&' => '&amp;'
'&' => '&amp;',
);
protected $htmlAttrSpecialChars = array(
@@ -227,7 +226,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
/**
* Convert a Unicode Codepoint to a literal UTF-8 character.
*
* @param int $codepoint Unicode codepoint in hex notation
* @param int $codepoint Unicode codepoint in hex notation
* @return string UTF-8 literal string
*/
protected function codepointToUtf8($codepoint)
@@ -256,7 +255,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
public function testJavascriptEscapingEscapesOwaspRecommendedRanges()
{
$immune = array(',', '.', '_'); // Exceptions to escaping ranges
for ($chr=0; $chr < 0xFF; $chr++) {
for ($chr = 0; $chr < 0xFF; $chr++) {
if ($chr >= 0x30 && $chr <= 0x39
|| $chr >= 0x41 && $chr <= 0x5A
|| $chr >= 0x61 && $chr <= 0x7A) {
@@ -279,7 +278,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges()
{
$immune = array(',', '.', '-', '_'); // Exceptions to escaping ranges
for ($chr=0; $chr < 0xFF; $chr++) {
for ($chr = 0; $chr < 0xFF; $chr++) {
if ($chr >= 0x30 && $chr <= 0x39
|| $chr >= 0x41 && $chr <= 0x5A
|| $chr >= 0x61 && $chr <= 0x7A) {
@@ -302,7 +301,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
public function testCssEscapingEscapesOwaspRecommendedRanges()
{
// CSS has no exceptions to escaping ranges
for ($chr=0; $chr < 0xFF; $chr++) {
for ($chr = 0; $chr < 0xFF; $chr++) {
if ($chr >= 0x30 && $chr <= 0x39
|| $chr >= 0x41 && $chr <= 0x5A
|| $chr >= 0x61 && $chr <= 0x7A) {