diff options
author | Nicolas Lœuillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
---|---|---|
committer | Nicolas Lœuillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
commit | 46b77928f746a4231d064774b5b67fd892c7ce86 (patch) | |
tree | e3ea690b3f0def1744ddae758923cf92171ef985 /vendor/twig/twig/test/Twig/Tests/Fixtures/functions | |
parent | 68abd9c71b1d2f7bb2e9d21819584d1d15005b25 (diff) | |
download | wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.gz wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.zst wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.zip |
rm vendor
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests/Fixtures/functions')
24 files changed, 0 insertions, 311 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test deleted file mode 100644 index 16ae1e8b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "attribute" function | ||
3 | --TEMPLATE-- | ||
4 | {{ attribute(obj, method) }} | ||
5 | {{ attribute(array, item) }} | ||
6 | {{ attribute(obj, "bar", ["a", "b"]) }} | ||
7 | --DATA-- | ||
8 | return array('obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => array('foo' => 'bar'), 'item' => 'foo') | ||
9 | --EXPECT-- | ||
10 | foo | ||
11 | bar | ||
12 | bar_a-b | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test deleted file mode 100644 index 8e54059a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "block" function | ||
3 | --TEMPLATE-- | ||
4 | {% extends 'base.twig' %} | ||
5 | {% block bar %}BAR{% endblock %} | ||
6 | --TEMPLATE(base.twig)-- | ||
7 | {% block foo %}{{ block('bar') }}{% endblock %} | ||
8 | {% block bar %}BAR_BASE{% endblock %} | ||
9 | --DATA-- | ||
10 | return array() | ||
11 | --EXPECT-- | ||
12 | BARBAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test deleted file mode 100644 index 63128791..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "constant" function | ||
3 | --TEMPLATE-- | ||
4 | {{ constant('DATE_W3C') == expect ? 'true' : 'false' }} | ||
5 | {{ constant('ARRAY_AS_PROPS', object) }} | ||
6 | --DATA-- | ||
7 | return array('expect' => DATE_W3C, 'object' => new ArrayObject(array('hi'))); | ||
8 | --EXPECT-- | ||
9 | true | ||
10 | 2 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test deleted file mode 100644 index 522a63b8..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "cycle" function | ||
3 | --TEMPLATE-- | ||
4 | {% for i in 0..6 %} | ||
5 | {{ cycle(array1, i) }}-{{ cycle(array2, i) }} | ||
6 | {% endfor %} | ||
7 | --DATA-- | ||
8 | return array('array1' => array('odd', 'even'), 'array2' => array('apple', 'orange', 'citrus')) | ||
9 | --EXPECT-- | ||
10 | odd-apple | ||
11 | even-orange | ||
12 | odd-citrus | ||
13 | even-apple | ||
14 | odd-orange | ||
15 | even-citrus | ||
16 | odd-apple | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test deleted file mode 100644 index a4c97167..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "date" function | ||
3 | --TEMPLATE-- | ||
4 | {{ date() == date('now') ? 'OK' : 'KO' }} | ||
5 | {{ date() > date('-1day') ? 'OK' : 'KO' }} | ||
6 | {{ date(date1) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} | ||
7 | {{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} | ||
8 | {{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} | ||
9 | {{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} | ||
10 | {{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }} | ||
11 | --DATA-- | ||
12 | date_default_timezone_set('UTC'); | ||
13 | return array( | ||
14 | 'date1' => mktime(13, 45, 0, 10, 4, 2010), | ||
15 | 'date2' => new DateTime('2010-10-04 13:45'), | ||
16 | 'date3' => '2010-10-04 13:45', | ||
17 | 'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT | ||
18 | 'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(), | ||
19 | ) | ||
20 | --EXPECT-- | ||
21 | OK | ||
22 | OK | ||
23 | OK | ||
24 | OK | ||
25 | OK | ||
26 | OK | ||
27 | OK | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test deleted file mode 100644 index b9dd9e38..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "date" function | ||
3 | --TEMPLATE-- | ||
4 | {{ date(date, "America/New_York")|date('d/m/Y H:i:s P', false) }} | ||
5 | {{ date(timezone="America/New_York", date=date)|date('d/m/Y H:i:s P', false) }} | ||
6 | --DATA-- | ||
7 | date_default_timezone_set('UTC'); | ||
8 | return array('date' => mktime(13, 45, 0, 10, 4, 2010)) | ||
9 | --EXPECT-- | ||
10 | 04/10/2010 09:45:00 -04:00 | ||
11 | 04/10/2010 09:45:00 -04:00 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test deleted file mode 100644 index f4072375..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "dump" function | ||
3 | --CONDITION-- | ||
4 | !extension_loaded('xdebug') | ||
5 | --TEMPLATE-- | ||
6 | {{ dump('foo') }} | ||
7 | {{ dump('foo', 'bar') }} | ||
8 | --DATA-- | ||
9 | return array('foo' => 'foo', 'bar' => 'bar') | ||
10 | --CONFIG-- | ||
11 | return array('debug' => true, 'autoescape' => false); | ||
12 | --EXPECT-- | ||
13 | string(3) "foo" | ||
14 | |||
15 | string(3) "foo" | ||
16 | string(3) "bar" | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test deleted file mode 100644 index 889b7a92..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded | ||
3 | --CONDITION-- | ||
4 | !extension_loaded('xdebug') || (($r = new ReflectionExtension('xdebug')) && version_compare($r->getVersion(), '2.2-dev', '<')) | ||
5 | --TEMPLATE-- | ||
6 | {{ dump() }} | ||
7 | --DATA-- | ||
8 | return array('foo' => 'foo', 'bar' => 'bar') | ||
9 | --CONFIG-- | ||
10 | return array('debug' => true, 'autoescape' => false); | ||
11 | --EXPECT-- | ||
12 | array(3) { | ||
13 | ["foo"]=> | ||
14 | string(3) "foo" | ||
15 | ["bar"]=> | ||
16 | string(3) "bar" | ||
17 | ["global"]=> | ||
18 | string(6) "global" | ||
19 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test deleted file mode 100644 index 913fbc99..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | dynamic function | ||
3 | --TEMPLATE-- | ||
4 | {{ foo_path('bar') }} | ||
5 | {{ a_foo_b_bar('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/functions/include/assignment.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test deleted file mode 100644 index b7653b4e..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function | ||
3 | --TEMPLATE-- | ||
4 | {% set tmp = include("foo.twig") %} | ||
5 | |||
6 | FOO{{ tmp }}BAR | ||
7 | --TEMPLATE(foo.twig)-- | ||
8 | FOOBAR | ||
9 | --DATA-- | ||
10 | return array() | ||
11 | --EXPECT-- | ||
12 | FOO | ||
13 | FOOBARBAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test deleted file mode 100644 index 56f8f3b5..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function is safe for auto-escaping | ||
3 | --TEMPLATE-- | ||
4 | {{ include("foo.twig") }} | ||
5 | --TEMPLATE(foo.twig)-- | ||
6 | <p>Test</p> | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
10 | <p>Test</p> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test deleted file mode 100644 index a434182a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function | ||
3 | --TEMPLATE-- | ||
4 | FOO | ||
5 | {{ include("foo.twig") }} | ||
6 | |||
7 | BAR | ||
8 | --TEMPLATE(foo.twig)-- | ||
9 | FOOBAR | ||
10 | --DATA-- | ||
11 | return array() | ||
12 | --EXPECT-- | ||
13 | FOO | ||
14 | |||
15 | FOOBAR | ||
16 | |||
17 | BAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test deleted file mode 100644 index aba30ce3..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function allows expressions for the template to include | ||
3 | --TEMPLATE-- | ||
4 | FOO | ||
5 | {{ include(foo) }} | ||
6 | |||
7 | BAR | ||
8 | --TEMPLATE(foo.twig)-- | ||
9 | FOOBAR | ||
10 | --DATA-- | ||
11 | return array('foo' => 'foo.twig') | ||
12 | --EXPECT-- | ||
13 | FOO | ||
14 | |||
15 | FOOBAR | ||
16 | |||
17 | BAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test deleted file mode 100644 index 43a2ccc2..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function | ||
3 | --TEMPLATE-- | ||
4 | {{ include(["foo.twig", "bar.twig"], ignore_missing = true) }} | ||
5 | {{ include("foo.twig", ignore_missing = true) }} | ||
6 | {{ include("foo.twig", ignore_missing = true, variables = {}) }} | ||
7 | {{ include("foo.twig", ignore_missing = true, variables = {}, with_context = true) }} | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXPECT-- | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test deleted file mode 100644 index 4d2f6cf1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function | ||
3 | --TEMPLATE-- | ||
4 | {{ include("foo.twig") }} | ||
5 | --DATA-- | ||
6 | return array(); | ||
7 | --EXCEPTION-- | ||
8 | Twig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2. | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test deleted file mode 100644 index 78fddc7a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function | ||
3 | --TEMPLATE-- | ||
4 | {% extends "base.twig" %} | ||
5 | |||
6 | {% block content %} | ||
7 | {{ parent() }} | ||
8 | {% endblock %} | ||
9 | --TEMPLATE(base.twig)-- | ||
10 | {% block content %} | ||
11 | {{ include("foo.twig") }} | ||
12 | {% endblock %} | ||
13 | --DATA-- | ||
14 | return array(); | ||
15 | --EXCEPTION-- | ||
16 | Twig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3. | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test deleted file mode 100644 index 788a2ab0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag sandboxed | ||
3 | --TEMPLATE-- | ||
4 | {{ include("foo.twig", sandboxed = true) }} | ||
5 | --TEMPLATE(foo.twig)-- | ||
6 | {{ foo|e }} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXCEPTION-- | ||
10 | Twig_Sandbox_SecurityError: Filter "e" is not allowed in "index.twig" at line 2. | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test deleted file mode 100644 index 18d405a0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function accepts Twig_Template instance | ||
3 | --TEMPLATE-- | ||
4 | {{ include(foo) }} FOO | ||
5 | --TEMPLATE(foo.twig)-- | ||
6 | BAR | ||
7 | --DATA-- | ||
8 | return array('foo' => $twig->loadTemplate('foo.twig')) | ||
9 | --EXPECT-- | ||
10 | BAR FOO | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test deleted file mode 100644 index 1a810068..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function | ||
3 | --TEMPLATE-- | ||
4 | {{ include(["foo.twig", "bar.twig"]) }} | ||
5 | {{- include(["bar.twig", "foo.twig"]) }} | ||
6 | --TEMPLATE(foo.twig)-- | ||
7 | foo | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXPECT-- | ||
11 | foo | ||
12 | foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test deleted file mode 100644 index 35611fbb..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function accept variables and with_context | ||
3 | --TEMPLATE-- | ||
4 | {{ include("foo.twig") }} | ||
5 | {{- include("foo.twig", with_context = false) }} | ||
6 | {{- include("foo.twig", {'foo1': 'bar'}) }} | ||
7 | {{- include("foo.twig", {'foo1': 'bar'}, with_context = false) }} | ||
8 | --TEMPLATE(foo.twig)-- | ||
9 | {% for k, v in _context %}{{ k }},{% endfor %} | ||
10 | --DATA-- | ||
11 | return array('foo' => 'bar') | ||
12 | --EXPECT-- | ||
13 | foo,global,_parent, | ||
14 | global,_parent, | ||
15 | foo,global,foo1,_parent, | ||
16 | foo1,global,_parent, | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test deleted file mode 100644 index b2ace940..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" function accept variables | ||
3 | --TEMPLATE-- | ||
4 | {{ include("foo.twig", {'foo': 'bar'}) }} | ||
5 | {{- include("foo.twig", vars) }} | ||
6 | --TEMPLATE(foo.twig)-- | ||
7 | {{ foo }} | ||
8 | --DATA-- | ||
9 | return array('vars' => array('foo' => 'bar')) | ||
10 | --EXPECT-- | ||
11 | bar | ||
12 | bar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test deleted file mode 100644 index e0377c8d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "range" function | ||
3 | --TEMPLATE-- | ||
4 | {{ range(low=0+1, high=10+0, step=2)|join(',') }} | ||
5 | --DATA-- | ||
6 | return array() | ||
7 | --EXPECT-- | ||
8 | 1,3,5,7,9 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test deleted file mode 100644 index 30c3df51..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "§" custom function | ||
3 | --TEMPLATE-- | ||
4 | {{ §('foo') }} | ||
5 | --DATA-- | ||
6 | return array() | ||
7 | --EXPECT-- | ||
8 | §foo§ | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test deleted file mode 100644 index 41428da1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "template_from_string" function | ||
3 | --TEMPLATE-- | ||
4 | {% include template_from_string(template) %} | ||
5 | |||
6 | {% include template_from_string("Hello {{ name }}") %} | ||
7 | --DATA-- | ||
8 | return array('name' => 'Fabien', 'template' => "Hello {{ name }}") | ||
9 | --EXPECT-- | ||
10 | Hello Fabien | ||
11 | Hello Fabien | ||