diff options
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests/Fixtures/filters')
36 files changed, 805 insertions, 0 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test new file mode 100644 index 00000000..27e93fd6 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test | |||
@@ -0,0 +1,30 @@ | |||
1 | --TEST-- | ||
2 | "abs" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ (-5.5)|abs }} | ||
5 | {{ (-5)|abs }} | ||
6 | {{ (-0)|abs }} | ||
7 | {{ 0|abs }} | ||
8 | {{ 5|abs }} | ||
9 | {{ 5.5|abs }} | ||
10 | {{ number1|abs }} | ||
11 | {{ number2|abs }} | ||
12 | {{ number3|abs }} | ||
13 | {{ number4|abs }} | ||
14 | {{ number5|abs }} | ||
15 | {{ number6|abs }} | ||
16 | --DATA-- | ||
17 | return array('number1' => -5.5, 'number2' => -5, 'number3' => -0, 'number4' => 0, 'number5' => 5, 'number6' => 5.5) | ||
18 | --EXPECT-- | ||
19 | 5.5 | ||
20 | 5 | ||
21 | 0 | ||
22 | 0 | ||
23 | 5 | ||
24 | 5.5 | ||
25 | 5.5 | ||
26 | 5 | ||
27 | 0 | ||
28 | 0 | ||
29 | 5 | ||
30 | 5.5 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test new file mode 100644 index 00000000..cb6de7f9 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test | |||
@@ -0,0 +1,31 @@ | |||
1 | --TEST-- | ||
2 | "batch" filter | ||
3 | --TEMPLATE-- | ||
4 | {% for row in items|batch(3) %} | ||
5 | <div class=row> | ||
6 | {% for column in row %} | ||
7 | <div class=item>{{ column }}</div> | ||
8 | {% endfor %} | ||
9 | </div> | ||
10 | {% endfor %} | ||
11 | --DATA-- | ||
12 | return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')) | ||
13 | --EXPECT-- | ||
14 | <div class=row> | ||
15 | <div class=item>a</div> | ||
16 | <div class=item>b</div> | ||
17 | <div class=item>c</div> | ||
18 | </div> | ||
19 | <div class=row> | ||
20 | <div class=item>d</div> | ||
21 | <div class=item>e</div> | ||
22 | <div class=item>f</div> | ||
23 | </div> | ||
24 | <div class=row> | ||
25 | <div class=item>g</div> | ||
26 | <div class=item>h</div> | ||
27 | <div class=item>i</div> | ||
28 | </div> | ||
29 | <div class=row> | ||
30 | <div class=item>j</div> | ||
31 | </div> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.php b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.php new file mode 100644 index 00000000..52de39cb --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.php | |||
@@ -0,0 +1,31 @@ | |||
1 | --TEST-- | ||
2 | "batch" filter | ||
3 | --TEMPLATE-- | ||
4 | {% for row in items|batch(3.1) %} | ||
5 | <div class=row> | ||
6 | {% for column in row %} | ||
7 | <div class=item>{{ column }}</div> | ||
8 | {% endfor %} | ||
9 | </div> | ||
10 | {% endfor %} | ||
11 | --DATA-- | ||
12 | return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')) | ||
13 | --EXPECT-- | ||
14 | <div class=row> | ||
15 | <div class=item>a</div> | ||
16 | <div class=item>b</div> | ||
17 | <div class=item>c</div> | ||
18 | </div> | ||
19 | <div class=row> | ||
20 | <div class=item>d</div> | ||
21 | <div class=item>e</div> | ||
22 | <div class=item>f</div> | ||
23 | </div> | ||
24 | <div class=row> | ||
25 | <div class=item>g</div> | ||
26 | <div class=item>h</div> | ||
27 | <div class=item>i</div> | ||
28 | </div> | ||
29 | <div class=row> | ||
30 | <div class=item>j</div> | ||
31 | </div> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test new file mode 100644 index 00000000..af996f24 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test | |||
@@ -0,0 +1,37 @@ | |||
1 | --TEST-- | ||
2 | "batch" filter | ||
3 | --TEMPLATE-- | ||
4 | <table> | ||
5 | {% for row in items|batch(3, '') %} | ||
6 | <tr> | ||
7 | {% for column in row %} | ||
8 | <td>{{ column }}</td> | ||
9 | {% endfor %} | ||
10 | </tr> | ||
11 | {% endfor %} | ||
12 | </table> | ||
13 | --DATA-- | ||
14 | return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')) | ||
15 | --EXPECT-- | ||
16 | <table> | ||
17 | <tr> | ||
18 | <td>a</td> | ||
19 | <td>b</td> | ||
20 | <td>c</td> | ||
21 | </tr> | ||
22 | <tr> | ||
23 | <td>d</td> | ||
24 | <td>e</td> | ||
25 | <td>f</td> | ||
26 | </tr> | ||
27 | <tr> | ||
28 | <td>g</td> | ||
29 | <td>h</td> | ||
30 | <td>i</td> | ||
31 | </tr> | ||
32 | <tr> | ||
33 | <td>j</td> | ||
34 | <td></td> | ||
35 | <td></td> | ||
36 | </tr> | ||
37 | </table> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test new file mode 100644 index 00000000..746295f1 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test | |||
@@ -0,0 +1,37 @@ | |||
1 | --TEST-- | ||
2 | "batch" filter | ||
3 | --TEMPLATE-- | ||
4 | <table> | ||
5 | {% for row in items|batch(3, 'fill') %} | ||
6 | <tr> | ||
7 | {% for column in row %} | ||
8 | <td>{{ column }}</td> | ||
9 | {% endfor %} | ||
10 | </tr> | ||
11 | {% endfor %} | ||
12 | </table> | ||
13 | --DATA-- | ||
14 | return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')) | ||
15 | --EXPECT-- | ||
16 | <table> | ||
17 | <tr> | ||
18 | <td>a</td> | ||
19 | <td>b</td> | ||
20 | <td>c</td> | ||
21 | </tr> | ||
22 | <tr> | ||
23 | <td>d</td> | ||
24 | <td>e</td> | ||
25 | <td>f</td> | ||
26 | </tr> | ||
27 | <tr> | ||
28 | <td>g</td> | ||
29 | <td>h</td> | ||
30 | <td>i</td> | ||
31 | </tr> | ||
32 | <tr> | ||
33 | <td>j</td> | ||
34 | <td>fill</td> | ||
35 | <td>fill</td> | ||
36 | </tr> | ||
37 | </table> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test new file mode 100644 index 00000000..380b04bb --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test | |||
@@ -0,0 +1,10 @@ | |||
1 | --TEST-- | ||
2 | "convert_encoding" filter | ||
3 | --CONDITION-- | ||
4 | function_exists('iconv') || function_exists('mb_convert_encoding') | ||
5 | --TEMPLATE-- | ||
6 | {{ "愛していますか?"|convert_encoding('ISO-2022-JP', 'UTF-8')|convert_encoding('UTF-8', 'ISO-2022-JP') }} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
10 | 愛していますか? | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test new file mode 100644 index 00000000..d40bb04a --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test | |||
@@ -0,0 +1,76 @@ | |||
1 | --TEST-- | ||
2 | "date" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ date1|date }} | ||
5 | {{ date1|date('d/m/Y') }} | ||
6 | {{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} | ||
7 | {{ date1|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} | ||
8 | {{ date1|date('d/m/Y H:i:s P', 'America/Chicago') }} | ||
9 | {{ date1|date('e') }} | ||
10 | {{ date1|date('d/m/Y H:i:s') }} | ||
11 | |||
12 | {{ date2|date }} | ||
13 | {{ date2|date('d/m/Y') }} | ||
14 | {{ date2|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} | ||
15 | {{ date2|date('d/m/Y H:i:s', timezone1) }} | ||
16 | {{ date2|date('d/m/Y H:i:s') }} | ||
17 | |||
18 | {{ date3|date }} | ||
19 | {{ date3|date('d/m/Y') }} | ||
20 | |||
21 | {{ date4|date }} | ||
22 | {{ date4|date('d/m/Y') }} | ||
23 | |||
24 | {{ date5|date }} | ||
25 | {{ date5|date('d/m/Y') }} | ||
26 | |||
27 | {{ date6|date('d/m/Y H:i:s P', 'Europe/Paris') }} | ||
28 | {{ date6|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} | ||
29 | {{ date6|date('d/m/Y H:i:s P', false) }} | ||
30 | {{ date6|date('e', 'Europe/Paris') }} | ||
31 | {{ date6|date('e', false) }} | ||
32 | |||
33 | {{ date7|date }} | ||
34 | --DATA-- | ||
35 | date_default_timezone_set('Europe/Paris'); | ||
36 | return array( | ||
37 | 'date1' => mktime(13, 45, 0, 10, 4, 2010), | ||
38 | 'date2' => new DateTime('2010-10-04 13:45'), | ||
39 | 'date3' => '2010-10-04 13:45', | ||
40 | 'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT | ||
41 | 'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(), | ||
42 | 'date6' => new DateTime('2010-10-04 13:45', new DateTimeZone('America/New_York')), | ||
43 | 'date7' => '2010-01-28T15:00:00+05:00', | ||
44 | 'timezone1' => new DateTimeZone('America/New_York'), | ||
45 | ) | ||
46 | --EXPECT-- | ||
47 | October 4, 2010 13:45 | ||
48 | 04/10/2010 | ||
49 | 04/10/2010 19:45:00 | ||
50 | 04/10/2010 19:45:00 +08:00 | ||
51 | 04/10/2010 06:45:00 -05:00 | ||
52 | Europe/Paris | ||
53 | 04/10/2010 13:45:00 | ||
54 | |||
55 | October 4, 2010 13:45 | ||
56 | 04/10/2010 | ||
57 | 04/10/2010 19:45:00 | ||
58 | 04/10/2010 07:45:00 | ||
59 | 04/10/2010 13:45:00 | ||
60 | |||
61 | October 4, 2010 13:45 | ||
62 | 04/10/2010 | ||
63 | |||
64 | October 4, 2010 15:45 | ||
65 | 04/10/2010 | ||
66 | |||
67 | January 2, 1964 04:04 | ||
68 | 02/01/1964 | ||
69 | |||
70 | 04/10/2010 19:45:00 +02:00 | ||
71 | 05/10/2010 01:45:00 +08:00 | ||
72 | 04/10/2010 13:45:00 -04:00 | ||
73 | Europe/Paris | ||
74 | America/New_York | ||
75 | |||
76 | January 28, 2010 11:00 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test new file mode 100644 index 00000000..11a1ef4b --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test | |||
@@ -0,0 +1,14 @@ | |||
1 | --TEST-- | ||
2 | "date" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ date1|date }} | ||
5 | {{ date1|date('d/m/Y') }} | ||
6 | --DATA-- | ||
7 | date_default_timezone_set('UTC'); | ||
8 | $twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours'); | ||
9 | return array( | ||
10 | 'date1' => mktime(13, 45, 0, 10, 4, 2010), | ||
11 | ) | ||
12 | --EXPECT-- | ||
13 | 2010-10-04 | ||
14 | 04/10/2010 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test new file mode 100644 index 00000000..e6d3707d --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test | |||
@@ -0,0 +1,16 @@ | |||
1 | --TEST-- | ||
2 | "date" filter (interval support as of PHP 5.3) | ||
3 | --CONDITION-- | ||
4 | version_compare(phpversion(), '5.3.0', '>=') | ||
5 | --TEMPLATE-- | ||
6 | {{ date2|date }} | ||
7 | {{ date2|date('%d days') }} | ||
8 | --DATA-- | ||
9 | date_default_timezone_set('UTC'); | ||
10 | $twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours'); | ||
11 | return array( | ||
12 | 'date2' => new DateInterval('P2D'), | ||
13 | ) | ||
14 | --EXPECT-- | ||
15 | 2 days 0 hours | ||
16 | 2 days | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test new file mode 100644 index 00000000..0c8c6f1a --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test | |||
@@ -0,0 +1,19 @@ | |||
1 | --TEST-- | ||
2 | "date" filter (interval support as of PHP 5.3) | ||
3 | --CONDITION-- | ||
4 | version_compare(phpversion(), '5.3.0', '>=') | ||
5 | --TEMPLATE-- | ||
6 | {{ date1|date }} | ||
7 | {{ date1|date('%d days %h hours') }} | ||
8 | {{ date1|date('%d days %h hours', timezone1) }} | ||
9 | --DATA-- | ||
10 | date_default_timezone_set('UTC'); | ||
11 | return array( | ||
12 | 'date1' => new DateInterval('P2D'), | ||
13 | // This should have no effect on DateInterval formatting | ||
14 | 'timezone1' => new DateTimeZone('America/New_York'), | ||
15 | ) | ||
16 | --EXPECT-- | ||
17 | 2 days | ||
18 | 2 days 0 hours | ||
19 | 2 days 0 hours | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test new file mode 100644 index 00000000..53d3a69c --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test | |||
@@ -0,0 +1,14 @@ | |||
1 | --TEST-- | ||
2 | "date_modify" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ date1|date_modify('-1day')|date('Y-m-d H:i:s') }} | ||
5 | {{ date2|date_modify('-1day')|date('Y-m-d H:i:s') }} | ||
6 | --DATA-- | ||
7 | date_default_timezone_set('UTC'); | ||
8 | return array( | ||
9 | 'date1' => '2010-10-04 13:45', | ||
10 | 'date2' => new DateTime('2010-10-04 13:45'), | ||
11 | ) | ||
12 | --EXPECT-- | ||
13 | 2010-10-03 13:45:00 | ||
14 | 2010-10-03 13:45:00 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test new file mode 100644 index 00000000..4ecde8a1 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test | |||
@@ -0,0 +1,13 @@ | |||
1 | --TEST-- | ||
2 | "date" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ date|date(format='d/m/Y H:i:s P', timezone='America/Chicago') }} | ||
5 | {{ date|date(timezone='America/Chicago', format='d/m/Y H:i:s P') }} | ||
6 | {{ date|date('d/m/Y H:i:s P', timezone='America/Chicago') }} | ||
7 | --DATA-- | ||
8 | date_default_timezone_set('UTC'); | ||
9 | return array('date' => mktime(13, 45, 0, 10, 4, 2010)) | ||
10 | --EXPECT-- | ||
11 | 04/10/2010 08:45:00 -05:00 | ||
12 | 04/10/2010 08:45:00 -05:00 | ||
13 | 04/10/2010 08:45:00 -05:00 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test new file mode 100644 index 00000000..0e4404b1 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test | |||
@@ -0,0 +1,150 @@ | |||
1 | --TEST-- | ||
2 | "default" filter | ||
3 | --TEMPLATE-- | ||
4 | Variable: | ||
5 | {{ definedVar |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
6 | {{ zeroVar |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
7 | {{ emptyVar |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
8 | {{ nullVar |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
9 | {{ undefinedVar |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
10 | Array access: | ||
11 | {{ nested.definedVar |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
12 | {{ nested['definedVar'] |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
13 | {{ nested.zeroVar |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
14 | {{ nested.emptyVar |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
15 | {{ nested.nullVar |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
16 | {{ nested.undefinedVar |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
17 | {{ nested['undefinedVar'] |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
18 | {{ undefinedVar.foo |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
19 | Plain values: | ||
20 | {{ 'defined' |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
21 | {{ 0 |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
22 | {{ '' |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
23 | {{ null |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
24 | Precedence: | ||
25 | {{ 'o' ~ nullVar |default('k') }} | ||
26 | {{ 'o' ~ nested.nullVar |default('k') }} | ||
27 | Object methods: | ||
28 | {{ object.foo |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
29 | {{ object.undefinedMethod |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
30 | {{ object.getFoo() |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
31 | {{ object.getFoo('a') |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
32 | {{ object.undefinedMethod() |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
33 | {{ object.undefinedMethod('a') |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
34 | Deep nested: | ||
35 | {{ nested.undefinedVar.foo.bar |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
36 | {{ nested.definedArray.0 |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
37 | {{ nested['definedArray'][0] |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
38 | {{ object.self.foo |default('default') is sameas('default') ? 'ko' : 'ok' }} | ||
39 | {{ object.self.undefinedMethod |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
40 | {{ object.undefinedMethod.self |default('default') is sameas('default') ? 'ok' : 'ko' }} | ||
41 | --DATA-- | ||
42 | return array( | ||
43 | 'definedVar' => 'defined', | ||
44 | 'zeroVar' => 0, | ||
45 | 'emptyVar' => '', | ||
46 | 'nullVar' => null, | ||
47 | 'nested' => array( | ||
48 | 'definedVar' => 'defined', | ||
49 | 'zeroVar' => 0, | ||
50 | 'emptyVar' => '', | ||
51 | 'nullVar' => null, | ||
52 | 'definedArray' => array(0), | ||
53 | ), | ||
54 | 'object' => new TwigTestFoo(), | ||
55 | ) | ||
56 | --CONFIG-- | ||
57 | return array('strict_variables' => false) | ||
58 | --EXPECT-- | ||
59 | Variable: | ||
60 | ok | ||
61 | ok | ||
62 | ok | ||
63 | ok | ||
64 | ok | ||
65 | Array access: | ||
66 | ok | ||
67 | ok | ||
68 | ok | ||
69 | ok | ||
70 | ok | ||
71 | ok | ||
72 | ok | ||
73 | ok | ||
74 | Plain values: | ||
75 | ok | ||
76 | ok | ||
77 | ok | ||
78 | ok | ||
79 | Precedence: | ||
80 | ok | ||
81 | ok | ||
82 | Object methods: | ||
83 | ok | ||
84 | ok | ||
85 | ok | ||
86 | ok | ||
87 | ok | ||
88 | ok | ||
89 | Deep nested: | ||
90 | ok | ||
91 | ok | ||
92 | ok | ||
93 | ok | ||
94 | ok | ||
95 | ok | ||
96 | --DATA-- | ||
97 | return array( | ||
98 | 'definedVar' => 'defined', | ||
99 | 'zeroVar' => 0, | ||
100 | 'emptyVar' => '', | ||
101 | 'nullVar' => null, | ||
102 | 'nested' => array( | ||
103 | 'definedVar' => 'defined', | ||
104 | 'zeroVar' => 0, | ||
105 | 'emptyVar' => '', | ||
106 | 'nullVar' => null, | ||
107 | 'definedArray' => array(0), | ||
108 | ), | ||
109 | 'object' => new TwigTestFoo(), | ||
110 | ) | ||
111 | --CONFIG-- | ||
112 | return array('strict_variables' => true) | ||
113 | --EXPECT-- | ||
114 | Variable: | ||
115 | ok | ||
116 | ok | ||
117 | ok | ||
118 | ok | ||
119 | ok | ||
120 | Array access: | ||
121 | ok | ||
122 | ok | ||
123 | ok | ||
124 | ok | ||
125 | ok | ||
126 | ok | ||
127 | ok | ||
128 | ok | ||
129 | Plain values: | ||
130 | ok | ||
131 | ok | ||
132 | ok | ||
133 | ok | ||
134 | Precedence: | ||
135 | ok | ||
136 | ok | ||
137 | Object methods: | ||
138 | ok | ||
139 | ok | ||
140 | ok | ||
141 | ok | ||
142 | ok | ||
143 | ok | ||
144 | Deep nested: | ||
145 | ok | ||
146 | ok | ||
147 | ok | ||
148 | ok | ||
149 | ok | ||
150 | ok | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test new file mode 100644 index 00000000..93c5913f --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test | |||
@@ -0,0 +1,10 @@ | |||
1 | --TEST-- | ||
2 | dynamic filter | ||
3 | --TEMPLATE-- | ||
4 | {{ 'bar'|foo_path }} | ||
5 | {{ 'bar'|a_foo_b_bar }} | ||
6 | --DATA-- | ||
7 | return array() | ||
8 | --EXPECT-- | ||
9 | foo/bar | ||
10 | a/b/bar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test new file mode 100644 index 00000000..a606c106 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test | |||
@@ -0,0 +1,8 @@ | |||
1 | --TEST-- | ||
2 | "escape" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ "foo <br />"|e }} | ||
5 | --DATA-- | ||
6 | return array() | ||
7 | --EXPECT-- | ||
8 | foo <br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test new file mode 100644 index 00000000..bba26a0d --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test | |||
@@ -0,0 +1,8 @@ | |||
1 | --TEST-- | ||
2 | "escape" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ "愛していますか? <br />"|e }} | ||
5 | --DATA-- | ||
6 | return array() | ||
7 | --EXPECT-- | ||
8 | 愛していますか? <br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test new file mode 100644 index 00000000..853465b6 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test | |||
@@ -0,0 +1,14 @@ | |||
1 | --TEST-- | ||
2 | "first" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ [1, 2, 3, 4]|first }} | ||
5 | {{ {a: 1, b: 2, c: 3, d: 4}|first }} | ||
6 | {{ '1234'|first }} | ||
7 | {{ arr|first }} | ||
8 | --DATA-- | ||
9 | return array('arr' => new ArrayObject(array(1, 2, 3, 4))) | ||
10 | --EXPECT-- | ||
11 | 1 | ||
12 | 1 | ||
13 | 1 | ||
14 | 1 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test new file mode 100644 index 00000000..85a9b717 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test | |||
@@ -0,0 +1,18 @@ | |||
1 | --TEST-- | ||
2 | "escape" filter | ||
3 | --TEMPLATE-- | ||
4 | {% set foo %} | ||
5 | foo<br /> | ||
6 | {% endset %} | ||
7 | |||
8 | {{ foo|e('html') -}} | ||
9 | {{ foo|e('js') }} | ||
10 | {% autoescape true %} | ||
11 | {{ foo }} | ||
12 | {% endautoescape %} | ||
13 | --DATA-- | ||
14 | return array() | ||
15 | --EXPECT-- | ||
16 | foo<br /> | ||
17 | \x20\x20\x20\x20foo\x3Cbr\x20\x2F\x3E\x0A | ||
18 | foo<br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test new file mode 100644 index 00000000..97221ff8 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test | |||
@@ -0,0 +1,8 @@ | |||
1 | --TEST-- | ||
2 | "format" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ string|format(foo, 3) }} | ||
5 | --DATA-- | ||
6 | return array('string' => '%s/%d', 'foo' => 'bar') | ||
7 | --EXPECT-- | ||
8 | bar/3 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test new file mode 100644 index 00000000..b342c174 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test | |||
@@ -0,0 +1,12 @@ | |||
1 | --TEST-- | ||
2 | "join" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ ["foo", "bar"]|join(', ') }} | ||
5 | {{ foo|join(', ') }} | ||
6 | {{ bar|join(', ') }} | ||
7 | --DATA-- | ||
8 | return array('foo' => new TwigTestFoo(), 'bar' => new ArrayObject(array(3, 4))) | ||
9 | --EXPECT-- | ||
10 | foo, bar | ||
11 | 1, 2 | ||
12 | 3, 4 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test new file mode 100644 index 00000000..1738d40c --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test | |||
@@ -0,0 +1,12 @@ | |||
1 | --TEST-- | ||
2 | "json_encode" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ "foo"|json_encode|raw }} | ||
5 | {{ foo|json_encode|raw }} | ||
6 | {{ [foo, "foo"]|json_encode|raw }} | ||
7 | --DATA-- | ||
8 | return array('foo' => new Twig_Markup('foo', 'UTF-8')) | ||
9 | --EXPECT-- | ||
10 | "foo" | ||
11 | "foo" | ||
12 | ["foo","foo"] | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test new file mode 100644 index 00000000..ca3ac0cf --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test | |||
@@ -0,0 +1,14 @@ | |||
1 | --TEST-- | ||
2 | "last" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ [1, 2, 3, 4]|last }} | ||
5 | {{ {a: 1, b: 2, c: 3, d: 4}|last }} | ||
6 | {{ '1234'|last }} | ||
7 | {{ arr|last }} | ||
8 | --DATA-- | ||
9 | return array('arr' => new ArrayObject(array(1, 2, 3, 4))) | ||
10 | --EXPECT-- | ||
11 | 4 | ||
12 | 4 | ||
13 | 4 | ||
14 | 4 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test new file mode 100644 index 00000000..3347474d --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test | |||
@@ -0,0 +1,14 @@ | |||
1 | --TEST-- | ||
2 | "length" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ array|length }} | ||
5 | {{ string|length }} | ||
6 | {{ number|length }} | ||
7 | {{ markup|length }} | ||
8 | --DATA-- | ||
9 | return array('array' => array(1, 4), 'string' => 'foo', 'number' => 1000, 'markup' => new Twig_Markup('foo', 'UTF-8')) | ||
10 | --EXPECT-- | ||
11 | 2 | ||
12 | 3 | ||
13 | 4 | ||
14 | 3 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test new file mode 100644 index 00000000..5d5e2436 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test | |||
@@ -0,0 +1,12 @@ | |||
1 | --TEST-- | ||
2 | "length" filter | ||
3 | --CONDITION-- | ||
4 | function_exists('mb_get_info') | ||
5 | --TEMPLATE-- | ||
6 | {{ string|length }} | ||
7 | {{ markup|length }} | ||
8 | --DATA-- | ||
9 | return array('string' => 'été', 'markup' => new Twig_Markup('foo', 'UTF-8')) | ||
10 | --EXPECT-- | ||
11 | 3 | ||
12 | 3 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test new file mode 100644 index 00000000..2bd3d4c0 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test | |||
@@ -0,0 +1,16 @@ | |||
1 | --TEST-- | ||
2 | "merge" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ items|merge({'bar': 'foo'})|join }} | ||
5 | {{ items|merge({'bar': 'foo'})|keys|join }} | ||
6 | {{ {'bar': 'foo'}|merge(items)|join }} | ||
7 | {{ {'bar': 'foo'}|merge(items)|keys|join }} | ||
8 | {{ numerics|merge([4, 5, 6])|join }} | ||
9 | --DATA-- | ||
10 | return array('items' => array('foo' => 'bar'), 'numerics' => array(1, 2, 3)) | ||
11 | --EXPECT-- | ||
12 | barfoo | ||
13 | foobar | ||
14 | foobar | ||
15 | barfoo | ||
16 | 123456 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test new file mode 100644 index 00000000..6545a9bb --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test | |||
@@ -0,0 +1,14 @@ | |||
1 | --TEST-- | ||
2 | "nl2br" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ "I like Twig.\nYou will like it too.\n\nEverybody like it!"|nl2br }} | ||
5 | {{ text|nl2br }} | ||
6 | --DATA-- | ||
7 | return array('text' => "If you have some <strong>HTML</strong>\nit will be escaped.") | ||
8 | --EXPECT-- | ||
9 | I like Twig.<br /> | ||
10 | You will like it too.<br /> | ||
11 | <br /> | ||
12 | Everybody like it! | ||
13 | If you have some <strong>HTML</strong><br /> | ||
14 | it will be escaped. | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test new file mode 100644 index 00000000..639a8659 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test | |||
@@ -0,0 +1,18 @@ | |||
1 | --TEST-- | ||
2 | "number_format" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ 20|number_format }} | ||
5 | {{ 20.25|number_format }} | ||
6 | {{ 20.25|number_format(2) }} | ||
7 | {{ 20.25|number_format(2, ',') }} | ||
8 | {{ 1020.25|number_format(2, ',') }} | ||
9 | {{ 1020.25|number_format(2, ',', '.') }} | ||
10 | --DATA-- | ||
11 | return array(); | ||
12 | --EXPECT-- | ||
13 | 20 | ||
14 | 20 | ||
15 | 20.25 | ||
16 | 20,25 | ||
17 | 1,020,25 | ||
18 | 1.020,25 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test new file mode 100644 index 00000000..c6903cc7 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test | |||
@@ -0,0 +1,21 @@ | |||
1 | --TEST-- | ||
2 | "number_format" filter with defaults. | ||
3 | --TEMPLATE-- | ||
4 | {{ 20|number_format }} | ||
5 | {{ 20.25|number_format }} | ||
6 | {{ 20.25|number_format(1) }} | ||
7 | {{ 20.25|number_format(2, ',') }} | ||
8 | {{ 1020.25|number_format }} | ||
9 | {{ 1020.25|number_format(2, ',') }} | ||
10 | {{ 1020.25|number_format(2, ',', '.') }} | ||
11 | --DATA-- | ||
12 | $twig->getExtension('core')->setNumberFormat(2, '!', '='); | ||
13 | return array(); | ||
14 | --EXPECT-- | ||
15 | 20!00 | ||
16 | 20!25 | ||
17 | 20!3 | ||
18 | 20,25 | ||
19 | 1=020!25 | ||
20 | 1=020,25 | ||
21 | 1.020,25 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test new file mode 100644 index 00000000..4021660b --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test | |||
@@ -0,0 +1,8 @@ | |||
1 | --TEST-- | ||
2 | "replace" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ "I like %this% and %that%."|replace({'%this%': "foo", '%that%': "bar"}) }} | ||
5 | --DATA-- | ||
6 | return array() | ||
7 | --EXPECT-- | ||
8 | I like foo and bar. | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test new file mode 100644 index 00000000..7948ac45 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test | |||
@@ -0,0 +1,18 @@ | |||
1 | --TEST-- | ||
2 | "reverse" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ [1, 2, 3, 4]|reverse|join('') }} | ||
5 | {{ '1234évènement'|reverse }} | ||
6 | {{ arr|reverse|join('') }} | ||
7 | {{ {'a': 'c', 'b': 'a'}|reverse()|join(',') }} | ||
8 | {{ {'a': 'c', 'b': 'a'}|reverse(preserveKeys=true)|join(glue=',') }} | ||
9 | {{ {'a': 'c', 'b': 'a'}|reverse(preserve_keys=true)|join(glue=',') }} | ||
10 | --DATA-- | ||
11 | return array('arr' => new ArrayObject(array(1, 2, 3, 4))) | ||
12 | --EXPECT-- | ||
13 | 4321 | ||
14 | tnemenèvé4321 | ||
15 | 4321 | ||
16 | a,c | ||
17 | a,c | ||
18 | a,c | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test new file mode 100644 index 00000000..b37ad651 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test | |||
@@ -0,0 +1,42 @@ | |||
1 | --TEST-- | ||
2 | "slice" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ [1, 2, 3, 4][1:2]|join('') }} | ||
5 | {{ {a: 1, b: 2, c: 3, d: 4}[1:2]|join('') }} | ||
6 | {{ [1, 2, 3, 4][start:length]|join('') }} | ||
7 | {{ [1, 2, 3, 4]|slice(1, 2)|join('') }} | ||
8 | {{ [1, 2, 3, 4]|slice(1, 2)|keys|join('') }} | ||
9 | {{ [1, 2, 3, 4]|slice(1, 2, true)|keys|join('') }} | ||
10 | {{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|join('') }} | ||
11 | {{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|keys|join('') }} | ||
12 | {{ '1234'|slice(1, 2) }} | ||
13 | {{ '1234'[1:2] }} | ||
14 | {{ arr|slice(1, 2)|join('') }} | ||
15 | {{ arr[1:2]|join('') }} | ||
16 | |||
17 | {{ [1, 2, 3, 4]|slice(1)|join('') }} | ||
18 | {{ [1, 2, 3, 4][1:]|join('') }} | ||
19 | {{ '1234'|slice(1) }} | ||
20 | {{ '1234'[1:] }} | ||
21 | {{ '1234'[:1] }} | ||
22 | --DATA-- | ||
23 | return array('start' => 1, 'length' => 2, 'arr' => new ArrayObject(array(1, 2, 3, 4))) | ||
24 | --EXPECT-- | ||
25 | 23 | ||
26 | 23 | ||
27 | 23 | ||
28 | 23 | ||
29 | 01 | ||
30 | 12 | ||
31 | 23 | ||
32 | bc | ||
33 | 23 | ||
34 | 23 | ||
35 | 23 | ||
36 | 23 | ||
37 | |||
38 | 234 | ||
39 | 234 | ||
40 | 234 | ||
41 | 234 | ||
42 | 1 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test new file mode 100644 index 00000000..21d575f1 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test | |||
@@ -0,0 +1,10 @@ | |||
1 | --TEST-- | ||
2 | "sort" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ array1|sort|join }} | ||
5 | {{ array2|sort|join }} | ||
6 | --DATA-- | ||
7 | return array('array1' => array(4, 1), 'array2' => array('foo', 'bar')) | ||
8 | --EXPECT-- | ||
9 | 14 | ||
10 | barfoo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test new file mode 100644 index 00000000..dbaf7dc9 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test | |||
@@ -0,0 +1,8 @@ | |||
1 | --TEST-- | ||
2 | "§" custom filter | ||
3 | --TEMPLATE-- | ||
4 | {{ 'foo'|§ }} | ||
5 | --DATA-- | ||
6 | return array() | ||
7 | --EXPECT-- | ||
8 | §foo§ | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test new file mode 100644 index 00000000..ce8ec9ce --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test | |||
@@ -0,0 +1,18 @@ | |||
1 | --TEST-- | ||
2 | "split" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ "one,two,three,four,five"|split(',')|join('-') }} | ||
5 | {{ foo|split(',')|join('-') }} | ||
6 | {{ foo|split(',', 3)|join('-') }} | ||
7 | {{ baz|split('')|join('-') }} | ||
8 | {{ baz|split('', 2)|join('-') }} | ||
9 | {{ foo|split(',', -2)|join('-') }} | ||
10 | --DATA-- | ||
11 | return array('foo' => "one,two,three,four,five", 'baz' => '12345',) | ||
12 | --EXPECT-- | ||
13 | one-two-three-four-five | ||
14 | one-two-three-four-five | ||
15 | one-two-three,four,five | ||
16 | 1-2-3-4-5 | ||
17 | 12-34-5 | ||
18 | one-two-three \ No newline at end of file | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test new file mode 100644 index 00000000..31920625 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test | |||
@@ -0,0 +1,12 @@ | |||
1 | --TEST-- | ||
2 | "trim" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ " I like Twig. "|trim }} | ||
5 | {{ text|trim }} | ||
6 | {{ " foo/"|trim("/") }} | ||
7 | --DATA-- | ||
8 | return array('text' => " If you have some <strong>HTML</strong> it will be escaped. ") | ||
9 | --EXPECT-- | ||
10 | I like Twig. | ||
11 | If you have some <strong>HTML</strong> it will be escaped. | ||
12 | foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test new file mode 100644 index 00000000..de956e7a --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test | |||
@@ -0,0 +1,12 @@ | |||
1 | --TEST-- | ||
2 | "url_encode" filter | ||
3 | --TEMPLATE-- | ||
4 | {{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} | ||
5 | {{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} | ||
6 | {{ {}|url_encode|default("default") }} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
10 | foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa+ce= | ||
11 | foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa+ce= | ||
12 | default | ||