mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 12:06:56 +00:00
Merge branch '3.x' into 4.x
* 3.x: Fix deprecations Fix intl-extra tests Fix CHANGELOG
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
"script_names" function
|
||||
--TEMPLATE--
|
||||
{{ script_names('UNKNOWN')|length }}
|
||||
{{ script_names()|length }}
|
||||
{{ script_names('fr')|length }}
|
||||
{{ script_names() is iterable }}
|
||||
{{ script_names('fr') is iterable }}
|
||||
{{ script_names()['Marc'] }}
|
||||
{{ script_names('fr')['Marc'] }}
|
||||
--DATA--
|
||||
return [];
|
||||
--EXPECT--
|
||||
0
|
||||
208
|
||||
208
|
||||
1
|
||||
1
|
||||
Marchen
|
||||
Marchen
|
||||
|
||||
@@ -156,7 +156,6 @@ class ParserTest extends TestCase
|
||||
], new Source('', '')));
|
||||
|
||||
$p = new \ReflectionProperty($parser, 'parent');
|
||||
$p->setAccessible(true);
|
||||
$this->assertNull($p->getValue($parser));
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ class TemplateTest extends TestCase
|
||||
$this->assertSame('One', $array['1']);
|
||||
$this->assertSame('FloatButString', $array['1.5']);
|
||||
$this->assertSame('IntegerButStringWithLeadingZeros', $array['01']);
|
||||
$this->assertSame('EmptyString', $array[null]);
|
||||
$this->assertSame('EmptyString', $array['']);
|
||||
|
||||
$this->assertSame('Zero', CoreExtension::getAttribute($twig, $template->getSourceContext(), $array, false), 'false is treated as 0 when accessing a sequence/mapping (equals PHP behavior)');
|
||||
$this->assertSame('One', CoreExtension::getAttribute($twig, $template->getSourceContext(), $array, true), 'true is treated as 1 when accessing a sequence/mapping (equals PHP behavior)');
|
||||
|
||||
Reference in New Issue
Block a user