|
| testRandomFunction ($value, $expectedInArray) |
| getRandomFunctionTestData More...
|
|
| getRandomFunctionTestData () |
|
| testRandomFunctionWithoutParameter () |
|
| testRandomFunctionReturnsAsIs () |
|
| testRandomFunctionOfEmptyArrayThrowsException () |
| Twig_Error_Runtime More...
|
|
| testRandomFunctionOnNonUTF8String () |
|
| testReverseFilterOnNonUTF8String () |
|
| testCustomEscaper ($expected, $string, $strategy) |
| provideCustomEscaperCases More...
|
|
| provideCustomEscaperCases () |
|
| testUnknownCustomEscaper () |
| Twig_Error_Runtime More...
|
|
| testTwigFirst ($expected, $input) |
| provideTwigFirstCases More...
|
|
| provideTwigFirstCases () |
|
| testTwigLast ($expected, $input) |
| provideTwigLastCases More...
|
|
| provideTwigLastCases () |
|
| testArrayKeysFilter (array $expected, $input) |
| provideArrayKeyCases More...
|
|
| provideArrayKeyCases () |
|
| testInFilter ($expected, $value, $compare) |
| provideInFilterCases More...
|
|
| provideInFilterCases () |
|
| testSliceFilter ($expected, $input, $start, $length=null, $preserveKeys=false) |
| provideSliceFilterCases More...
|
|
| provideSliceFilterCases () |
|
Definition at line 12 of file CoreTest.php.
◆ getRandomFunctionTestData()
Twig_Tests_Extension_CoreTest::getRandomFunctionTestData |
( |
| ) |
|
Definition at line 26 of file CoreTest.php.
References array, and range.
30 array(
'apple',
'orange',
'citrus'),
31 array(
'apple',
'orange',
'citrus'),
35 array(
'apple',
'orange',
'citrus'),
Create styles array
The data for the language used.
◆ provideArrayKeyCases()
Twig_Tests_Extension_CoreTest::provideArrayKeyCases |
( |
| ) |
|
Definition at line 198 of file CoreTest.php.
References $keys, and array.
200 $array =
array(
'a' =>
'a1',
'b' =>
'b1',
'c' =>
'c1');
201 $keys = array_keys($array);
Create styles array
The data for the language used.
◆ provideCustomEscaperCases()
Twig_Tests_Extension_CoreTest::provideCustomEscaperCases |
( |
| ) |
|
Definition at line 129 of file CoreTest.php.
References array.
132 array(
'fooUTF-8',
'foo',
'foo'),
133 array(
'UTF-8', null,
'foo'),
134 array(
'42UTF-8', 42,
'foo'),
Create styles array
The data for the language used.
◆ provideInFilterCases()
Twig_Tests_Extension_CoreTest::provideInFilterCases |
( |
| ) |
|
Definition at line 221 of file CoreTest.php.
References $keys, and array.
223 $array =
array(1, 2,
'a' => 3, 5, 6, 7);
224 $keys = array_keys($array);
227 array(
true, 1, $array),
228 array(
true,
'3', $array),
229 array(
true,
'3',
'abc3def'),
233 array(
false, 4, $array),
Create styles array
The data for the language used.
◆ provideSliceFilterCases()
Twig_Tests_Extension_CoreTest::provideSliceFilterCases |
( |
| ) |
|
Definition at line 250 of file CoreTest.php.
References $i, $keys, and array.
252 $i =
array(
'a' => 1,
'b' => 2,
'c' => 3,
'd' => 4);
265 array(
'de',
'abcdef', 3, 2),
Create styles array
The data for the language used.
◆ provideTwigFirstCases()
Twig_Tests_Extension_CoreTest::provideTwigFirstCases |
( |
| ) |
|
Definition at line 155 of file CoreTest.php.
References $i, and array.
157 $i =
array(1 =>
'a', 2 =>
'b', 3 =>
'c');
Create styles array
The data for the language used.
◆ provideTwigLastCases()
Twig_Tests_Extension_CoreTest::provideTwigLastCases |
( |
| ) |
|
Definition at line 177 of file CoreTest.php.
References $i, and array.
179 $i =
array(1 =>
'a', 2 =>
'b', 3 =>
'c');
Create styles array
The data for the language used.
◆ testArrayKeysFilter()
Twig_Tests_Extension_CoreTest::testArrayKeysFilter |
( |
array |
$expected, |
|
|
|
$input |
|
) |
| |
provideArrayKeyCases
Definition at line 193 of file CoreTest.php.
195 $this->assertSame($expected, twig_get_array_keys_filter($input));
◆ testCustomEscaper()
Twig_Tests_Extension_CoreTest::testCustomEscaper |
( |
|
$expected, |
|
|
|
$string, |
|
|
|
$strategy |
|
) |
| |
provideCustomEscaperCases
Definition at line 121 of file CoreTest.php.
123 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock());
124 $twig->getExtension(
'Twig_Extension_Core')->setEscaper(
'foo',
'foo_escaper_for_test');
126 $this->assertSame($expected, twig_escape_filter($twig, $string, $strategy));
Stores the Twig configuration.
◆ testInFilter()
Twig_Tests_Extension_CoreTest::testInFilter |
( |
|
$expected, |
|
|
|
$value, |
|
|
|
$compare |
|
) |
| |
provideInFilterCases
Definition at line 216 of file CoreTest.php.
218 $this->assertSame($expected, twig_in_filter($value, $compare));
◆ testRandomFunction()
Twig_Tests_Extension_CoreTest::testRandomFunction |
( |
|
$value, |
|
|
|
$expectedInArray |
|
) |
| |
getRandomFunctionTestData
Definition at line 17 of file CoreTest.php.
References $env, $i, and twig_random().
21 for (
$i = 0;
$i < 100; ++
$i) {
22 $this->assertTrue(in_array(
twig_random(
$env, $value), $expectedInArray,
true));
twig_random(Twig_Environment $env, $values=null)
Returns a random value depending on the supplied parameter type:
Stores the Twig configuration.
◆ testRandomFunctionOfEmptyArrayThrowsException()
Twig_Tests_Extension_CoreTest::testRandomFunctionOfEmptyArrayThrowsException |
( |
| ) |
|
Twig_Error_Runtime
Definition at line 82 of file CoreTest.php.
References array, and twig_random().
Create styles array
The data for the language used.
twig_random(Twig_Environment $env, $values=null)
Returns a random value depending on the supplied parameter type:
Stores the Twig configuration.
◆ testRandomFunctionOnNonUTF8String()
Twig_Tests_Extension_CoreTest::testRandomFunctionOnNonUTF8String |
( |
| ) |
|
Definition at line 87 of file CoreTest.php.
References $i, $text, array, and twig_random().
89 if (!function_exists(
'iconv') && !function_exists(
'mb_convert_encoding')) {
90 $this->markTestSkipped(
'needs iconv or mbstring');
93 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock());
94 $twig->setCharset(
'ISO-8859-1');
96 $text = twig_convert_encoding(
'Äé',
'ISO-8859-1',
'UTF-8');
97 for (
$i = 0;
$i < 30; ++
$i) {
99 $this->assertTrue(in_array(twig_convert_encoding($rand,
'UTF-8',
'ISO-8859-1'),
array(
'Ä',
'é'),
true));
Create styles array
The data for the language used.
twig_random(Twig_Environment $env, $values=null)
Returns a random value depending on the supplied parameter type:
Stores the Twig configuration.
◆ testRandomFunctionReturnsAsIs()
Twig_Tests_Extension_CoreTest::testRandomFunctionReturnsAsIs |
( |
| ) |
|
Definition at line 70 of file CoreTest.php.
References array, and twig_random().
75 $instance =
new stdClass();
76 $this->assertSame($instance,
twig_random(
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock()), $instance));
Create styles array
The data for the language used.
twig_random(Twig_Environment $env, $values=null)
Returns a random value depending on the supplied parameter type:
Stores the Twig configuration.
◆ testRandomFunctionWithoutParameter()
Twig_Tests_Extension_CoreTest::testRandomFunctionWithoutParameter |
( |
| ) |
|
Definition at line 60 of file CoreTest.php.
References $i, and twig_random().
62 $max = mt_getrandmax();
64 for (
$i = 0;
$i < 100; ++
$i) {
66 $this->assertTrue(is_int($val) && $val >= 0 && $val <= $max);
twig_random(Twig_Environment $env, $values=null)
Returns a random value depending on the supplied parameter type:
Stores the Twig configuration.
◆ testReverseFilterOnNonUTF8String()
Twig_Tests_Extension_CoreTest::testReverseFilterOnNonUTF8String |
( |
| ) |
|
Definition at line 103 of file CoreTest.php.
References $output.
105 if (!function_exists(
'iconv') && !function_exists(
'mb_convert_encoding')) {
106 $this->markTestSkipped(
'needs iconv or mbstring');
109 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock());
110 $twig->setCharset(
'ISO-8859-1');
112 $input = twig_convert_encoding(
'Äé',
'ISO-8859-1',
'UTF-8');
113 $output = twig_convert_encoding(twig_reverse_filter($twig, $input),
'UTF-8',
'ISO-8859-1');
115 $this->assertEquals(
$output,
'éÄ');
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
Stores the Twig configuration.
◆ testSliceFilter()
Twig_Tests_Extension_CoreTest::testSliceFilter |
( |
|
$expected, |
|
|
|
$input, |
|
|
|
$start, |
|
|
|
$length = null , |
|
|
|
$preserveKeys = false |
|
) |
| |
provideSliceFilterCases
Definition at line 244 of file CoreTest.php.
246 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock());
247 $this->assertSame($expected, twig_slice($twig, $input, $start, $length, $preserveKeys));
Stores the Twig configuration.
◆ testTwigFirst()
Twig_Tests_Extension_CoreTest::testTwigFirst |
( |
|
$expected, |
|
|
|
$input |
|
) |
| |
provideTwigFirstCases
Definition at line 149 of file CoreTest.php.
151 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock());
152 $this->assertSame($expected, twig_first($twig, $input));
Stores the Twig configuration.
◆ testTwigLast()
Twig_Tests_Extension_CoreTest::testTwigLast |
( |
|
$expected, |
|
|
|
$input |
|
) |
| |
provideTwigLastCases
Definition at line 171 of file CoreTest.php.
173 $twig =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock());
174 $this->assertSame($expected, twig_last($twig, $input));
Stores the Twig configuration.
◆ testUnknownCustomEscaper()
Twig_Tests_Extension_CoreTest::testUnknownCustomEscaper |
( |
| ) |
|
The documentation for this class was generated from the following file:
- libs/composer/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php