diff options
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests')
269 files changed, 0 insertions, 10158 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php b/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php deleted file mode 100644 index c8b7999a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_AutoloaderTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | public function testAutoload() | ||
15 | { | ||
16 | $this->assertFalse(class_exists('FooBarFoo'), '->autoload() does not try to load classes that does not begin with Twig'); | ||
17 | |||
18 | $autoloader = new Twig_Autoloader(); | ||
19 | $this->assertNull($autoloader->autoload('Foo'), '->autoload() returns false if it is not able to load a class'); | ||
20 | } | ||
21 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/CompilerTest.php b/vendor/twig/twig/test/Twig/Tests/CompilerTest.php deleted file mode 100644 index ebe79aef..00000000 --- a/vendor/twig/twig/test/Twig/Tests/CompilerTest.php +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_CompilerTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | public function testReprNumericValueWithLocale() | ||
15 | { | ||
16 | $compiler = new Twig_Compiler(new Twig_Environment()); | ||
17 | |||
18 | $locale = setlocale(LC_NUMERIC, 0); | ||
19 | if (false === $locale) { | ||
20 | $this->markTestSkipped('Your platform does not support locales.'); | ||
21 | } | ||
22 | |||
23 | $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); | ||
24 | if (false === setlocale(LC_ALL, $required_locales)) { | ||
25 | $this->markTestSkipped('Could not set any of required locales: ' . implode(", ", $required_locales)); | ||
26 | } | ||
27 | |||
28 | $this->assertEquals('1.2', $compiler->repr(1.2)->getSource()); | ||
29 | $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); | ||
30 | |||
31 | setlocale(LC_ALL, $locale); | ||
32 | } | ||
33 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php b/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php deleted file mode 100644 index 22461b5d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php +++ /dev/null | |||
@@ -1,288 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | /** | ||
15 | * @expectedException LogicException | ||
16 | * @expectedExceptionMessage You must set a loader first. | ||
17 | */ | ||
18 | public function testRenderNoLoader() | ||
19 | { | ||
20 | $env = new Twig_Environment(); | ||
21 | $env->render('test'); | ||
22 | } | ||
23 | |||
24 | public function testAutoescapeOption() | ||
25 | { | ||
26 | $loader = new Twig_Loader_Array(array( | ||
27 | 'html' => '{{ foo }} {{ foo }}', | ||
28 | 'js' => '{{ bar }} {{ bar }}', | ||
29 | )); | ||
30 | |||
31 | $twig = new Twig_Environment($loader, array( | ||
32 | 'debug' => true, | ||
33 | 'cache' => false, | ||
34 | 'autoescape' => array($this, 'escapingStrategyCallback'), | ||
35 | )); | ||
36 | |||
37 | $this->assertEquals('foo<br/ > foo<br/ >', $twig->render('html', array('foo' => 'foo<br/ >'))); | ||
38 | $this->assertEquals('foo\x3Cbr\x2F\x20\x3E foo\x3Cbr\x2F\x20\x3E', $twig->render('js', array('bar' => 'foo<br/ >'))); | ||
39 | } | ||
40 | |||
41 | public function escapingStrategyCallback($filename) | ||
42 | { | ||
43 | return $filename; | ||
44 | } | ||
45 | |||
46 | public function testGlobals() | ||
47 | { | ||
48 | // globals can be added after calling getGlobals | ||
49 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
50 | $twig->addGlobal('foo', 'foo'); | ||
51 | $globals = $twig->getGlobals(); | ||
52 | $twig->addGlobal('foo', 'bar'); | ||
53 | $globals = $twig->getGlobals(); | ||
54 | $this->assertEquals('bar', $globals['foo']); | ||
55 | |||
56 | // globals can be modified after runtime init | ||
57 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
58 | $twig->addGlobal('foo', 'foo'); | ||
59 | $globals = $twig->getGlobals(); | ||
60 | $twig->initRuntime(); | ||
61 | $twig->addGlobal('foo', 'bar'); | ||
62 | $globals = $twig->getGlobals(); | ||
63 | $this->assertEquals('bar', $globals['foo']); | ||
64 | |||
65 | // globals can be modified after extensions init | ||
66 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
67 | $twig->addGlobal('foo', 'foo'); | ||
68 | $globals = $twig->getGlobals(); | ||
69 | $twig->getFunctions(); | ||
70 | $twig->addGlobal('foo', 'bar'); | ||
71 | $globals = $twig->getGlobals(); | ||
72 | $this->assertEquals('bar', $globals['foo']); | ||
73 | |||
74 | // globals can be modified after extensions and runtime init | ||
75 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
76 | $twig->addGlobal('foo', 'foo'); | ||
77 | $globals = $twig->getGlobals(); | ||
78 | $twig->getFunctions(); | ||
79 | $twig->initRuntime(); | ||
80 | $twig->addGlobal('foo', 'bar'); | ||
81 | $globals = $twig->getGlobals(); | ||
82 | $this->assertEquals('bar', $globals['foo']); | ||
83 | |||
84 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
85 | $twig->getGlobals(); | ||
86 | $twig->addGlobal('foo', 'bar'); | ||
87 | $template = $twig->loadTemplate('{{foo}}'); | ||
88 | $this->assertEquals('bar', $template->render(array())); | ||
89 | |||
90 | /* to be uncomment in Twig 2.0 | ||
91 | // globals cannot be added after runtime init | ||
92 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
93 | $twig->addGlobal('foo', 'foo'); | ||
94 | $globals = $twig->getGlobals(); | ||
95 | $twig->initRuntime(); | ||
96 | try { | ||
97 | $twig->addGlobal('bar', 'bar'); | ||
98 | $this->fail(); | ||
99 | } catch (LogicException $e) { | ||
100 | $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); | ||
101 | } | ||
102 | |||
103 | // globals cannot be added after extensions init | ||
104 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
105 | $twig->addGlobal('foo', 'foo'); | ||
106 | $globals = $twig->getGlobals(); | ||
107 | $twig->getFunctions(); | ||
108 | try { | ||
109 | $twig->addGlobal('bar', 'bar'); | ||
110 | $this->fail(); | ||
111 | } catch (LogicException $e) { | ||
112 | $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); | ||
113 | } | ||
114 | |||
115 | // globals cannot be added after extensions and runtime init | ||
116 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
117 | $twig->addGlobal('foo', 'foo'); | ||
118 | $globals = $twig->getGlobals(); | ||
119 | $twig->getFunctions(); | ||
120 | $twig->initRuntime(); | ||
121 | try { | ||
122 | $twig->addGlobal('bar', 'bar'); | ||
123 | $this->fail(); | ||
124 | } catch (LogicException $e) { | ||
125 | $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); | ||
126 | } | ||
127 | |||
128 | // test adding globals after initRuntime without call to getGlobals | ||
129 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
130 | $twig->initRuntime(); | ||
131 | try { | ||
132 | $twig->addGlobal('bar', 'bar'); | ||
133 | $this->fail(); | ||
134 | } catch (LogicException $e) { | ||
135 | $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); | ||
136 | } | ||
137 | */ | ||
138 | } | ||
139 | |||
140 | public function testExtensionsAreNotInitializedWhenRenderingACompiledTemplate() | ||
141 | { | ||
142 | $options = array('cache' => sys_get_temp_dir().'/twig', 'auto_reload' => false, 'debug' => false); | ||
143 | |||
144 | // force compilation | ||
145 | $twig = new Twig_Environment(new Twig_Loader_String(), $options); | ||
146 | $cache = $twig->getCacheFilename('{{ foo }}'); | ||
147 | if (!is_dir(dirname($cache))) { | ||
148 | mkdir(dirname($cache), 0777, true); | ||
149 | } | ||
150 | file_put_contents($cache, $twig->compileSource('{{ foo }}', '{{ foo }}')); | ||
151 | |||
152 | // check that extensions won't be initialized when rendering a template that is already in the cache | ||
153 | $twig = $this | ||
154 | ->getMockBuilder('Twig_Environment') | ||
155 | ->setConstructorArgs(array(new Twig_Loader_String(), $options)) | ||
156 | ->setMethods(array('initExtensions')) | ||
157 | ->getMock() | ||
158 | ; | ||
159 | |||
160 | $twig->expects($this->never())->method('initExtensions'); | ||
161 | |||
162 | // render template | ||
163 | $output = $twig->render('{{ foo }}', array('foo' => 'bar')); | ||
164 | $this->assertEquals('bar', $output); | ||
165 | |||
166 | unlink($cache); | ||
167 | } | ||
168 | |||
169 | public function testAddExtension() | ||
170 | { | ||
171 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
172 | $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension()); | ||
173 | |||
174 | $this->assertArrayHasKey('test', $twig->getTags()); | ||
175 | $this->assertArrayHasKey('foo_filter', $twig->getFilters()); | ||
176 | $this->assertArrayHasKey('foo_function', $twig->getFunctions()); | ||
177 | $this->assertArrayHasKey('foo_test', $twig->getTests()); | ||
178 | $this->assertArrayHasKey('foo_unary', $twig->getUnaryOperators()); | ||
179 | $this->assertArrayHasKey('foo_binary', $twig->getBinaryOperators()); | ||
180 | $this->assertArrayHasKey('foo_global', $twig->getGlobals()); | ||
181 | $visitors = $twig->getNodeVisitors(); | ||
182 | $this->assertEquals('Twig_Tests_EnvironmentTest_NodeVisitor', get_class($visitors[2])); | ||
183 | } | ||
184 | |||
185 | public function testRemoveExtension() | ||
186 | { | ||
187 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
188 | $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension()); | ||
189 | $twig->removeExtension('environment_test'); | ||
190 | |||
191 | $this->assertFalse(array_key_exists('test', $twig->getTags())); | ||
192 | $this->assertFalse(array_key_exists('foo_filter', $twig->getFilters())); | ||
193 | $this->assertFalse(array_key_exists('foo_function', $twig->getFunctions())); | ||
194 | $this->assertFalse(array_key_exists('foo_test', $twig->getTests())); | ||
195 | $this->assertFalse(array_key_exists('foo_unary', $twig->getUnaryOperators())); | ||
196 | $this->assertFalse(array_key_exists('foo_binary', $twig->getBinaryOperators())); | ||
197 | $this->assertFalse(array_key_exists('foo_global', $twig->getGlobals())); | ||
198 | $this->assertCount(2, $twig->getNodeVisitors()); | ||
199 | } | ||
200 | } | ||
201 | |||
202 | class Twig_Tests_EnvironmentTest_Extension extends Twig_Extension | ||
203 | { | ||
204 | public function getTokenParsers() | ||
205 | { | ||
206 | return array( | ||
207 | new Twig_Tests_EnvironmentTest_TokenParser(), | ||
208 | ); | ||
209 | } | ||
210 | |||
211 | public function getNodeVisitors() | ||
212 | { | ||
213 | return array( | ||
214 | new Twig_Tests_EnvironmentTest_NodeVisitor(), | ||
215 | ); | ||
216 | } | ||
217 | |||
218 | public function getFilters() | ||
219 | { | ||
220 | return array( | ||
221 | 'foo_filter' => new Twig_Filter_Function('foo_filter'), | ||
222 | ); | ||
223 | } | ||
224 | |||
225 | public function getTests() | ||
226 | { | ||
227 | return array( | ||
228 | 'foo_test' => new Twig_Test_Function('foo_test'), | ||
229 | ); | ||
230 | } | ||
231 | |||
232 | public function getFunctions() | ||
233 | { | ||
234 | return array( | ||
235 | 'foo_function' => new Twig_Function_Function('foo_function'), | ||
236 | ); | ||
237 | } | ||
238 | |||
239 | public function getOperators() | ||
240 | { | ||
241 | return array( | ||
242 | array('foo_unary' => array()), | ||
243 | array('foo_binary' => array()), | ||
244 | ); | ||
245 | } | ||
246 | |||
247 | public function getGlobals() | ||
248 | { | ||
249 | return array( | ||
250 | 'foo_global' => 'foo_global', | ||
251 | ); | ||
252 | } | ||
253 | |||
254 | public function getName() | ||
255 | { | ||
256 | return 'environment_test'; | ||
257 | } | ||
258 | } | ||
259 | |||
260 | class Twig_Tests_EnvironmentTest_TokenParser extends Twig_TokenParser | ||
261 | { | ||
262 | public function parse(Twig_Token $token) | ||
263 | { | ||
264 | } | ||
265 | |||
266 | public function getTag() | ||
267 | { | ||
268 | return 'test'; | ||
269 | } | ||
270 | } | ||
271 | |||
272 | class Twig_Tests_EnvironmentTest_NodeVisitor implements Twig_NodeVisitorInterface | ||
273 | { | ||
274 | public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) | ||
275 | { | ||
276 | return $node; | ||
277 | } | ||
278 | |||
279 | public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) | ||
280 | { | ||
281 | return $node; | ||
282 | } | ||
283 | |||
284 | public function getPriority() | ||
285 | { | ||
286 | return 0; | ||
287 | } | ||
288 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/ErrorTest.php b/vendor/twig/twig/test/Twig/Tests/ErrorTest.php deleted file mode 100644 index 9b286974..00000000 --- a/vendor/twig/twig/test/Twig/Tests/ErrorTest.php +++ /dev/null | |||
@@ -1,159 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | public function testErrorWithObjectFilename() | ||
15 | { | ||
16 | $error = new Twig_Error('foo'); | ||
17 | $error->setTemplateFile(new SplFileInfo(__FILE__)); | ||
18 | |||
19 | $this->assertContains('test'.DIRECTORY_SEPARATOR.'Twig'.DIRECTORY_SEPARATOR.'Tests'.DIRECTORY_SEPARATOR.'ErrorTest.php', $error->getMessage()); | ||
20 | } | ||
21 | |||
22 | public function testErrorWithArrayFilename() | ||
23 | { | ||
24 | $error = new Twig_Error('foo'); | ||
25 | $error->setTemplateFile(array('foo' => 'bar')); | ||
26 | |||
27 | $this->assertEquals('foo in {"foo":"bar"}', $error->getMessage()); | ||
28 | } | ||
29 | |||
30 | public function testTwigExceptionAddsFileAndLineWhenMissing() | ||
31 | { | ||
32 | $loader = new Twig_Loader_Array(array('index' => "\n\n{{ foo.bar }}\n\n\n{{ 'foo' }}")); | ||
33 | $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); | ||
34 | |||
35 | $template = $twig->loadTemplate('index'); | ||
36 | |||
37 | try { | ||
38 | $template->render(array()); | ||
39 | |||
40 | $this->fail(); | ||
41 | } catch (Twig_Error_Runtime $e) { | ||
42 | $this->assertEquals('Variable "foo" does not exist in "index" at line 3', $e->getMessage()); | ||
43 | $this->assertEquals(3, $e->getTemplateLine()); | ||
44 | $this->assertEquals('index', $e->getTemplateFile()); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | public function testRenderWrapsExceptions() | ||
49 | { | ||
50 | $loader = new Twig_Loader_Array(array('index' => "\n\n\n{{ foo.bar }}\n\n\n\n{{ 'foo' }}")); | ||
51 | $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); | ||
52 | |||
53 | $template = $twig->loadTemplate('index'); | ||
54 | |||
55 | try { | ||
56 | $template->render(array('foo' => new Twig_Tests_ErrorTest_Foo())); | ||
57 | |||
58 | $this->fail(); | ||
59 | } catch (Twig_Error_Runtime $e) { | ||
60 | $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...") in "index" at line 4.', $e->getMessage()); | ||
61 | $this->assertEquals(4, $e->getTemplateLine()); | ||
62 | $this->assertEquals('index', $e->getTemplateFile()); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | public function testTwigExceptionAddsFileAndLineWhenMissingWithInheritance() | ||
67 | { | ||
68 | $loader = new Twig_Loader_Array(array( | ||
69 | 'index' => "{% extends 'base' %} | ||
70 | {% block content %} | ||
71 | {{ foo.bar }} | ||
72 | {% endblock %} | ||
73 | {% block foo %} | ||
74 | {{ foo.bar }} | ||
75 | {% endblock %}", | ||
76 | 'base' => '{% block content %}{% endblock %}' | ||
77 | )); | ||
78 | $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); | ||
79 | |||
80 | $template = $twig->loadTemplate('index'); | ||
81 | try { | ||
82 | $template->render(array()); | ||
83 | |||
84 | $this->fail(); | ||
85 | } catch (Twig_Error_Runtime $e) { | ||
86 | $this->assertEquals('Variable "foo" does not exist in "index" at line 3', $e->getMessage()); | ||
87 | $this->assertEquals(3, $e->getTemplateLine()); | ||
88 | $this->assertEquals('index', $e->getTemplateFile()); | ||
89 | } | ||
90 | |||
91 | try { | ||
92 | $template->render(array('foo' => new Twig_Tests_ErrorTest_Foo())); | ||
93 | |||
94 | $this->fail(); | ||
95 | } catch (Twig_Error_Runtime $e) { | ||
96 | $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...") in "index" at line 3.', $e->getMessage()); | ||
97 | $this->assertEquals(3, $e->getTemplateLine()); | ||
98 | $this->assertEquals('index', $e->getTemplateFile()); | ||
99 | } | ||
100 | } | ||
101 | |||
102 | public function testTwigExceptionAddsFileAndLineWhenMissingWithInheritanceAgain() | ||
103 | { | ||
104 | $loader = new Twig_Loader_Array(array( | ||
105 | 'index' => "{% extends 'base' %} | ||
106 | {% block content %} | ||
107 | {{ parent() }} | ||
108 | {% endblock %}", | ||
109 | 'base' => '{% block content %}{{ foo }}{% endblock %}' | ||
110 | )); | ||
111 | $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); | ||
112 | |||
113 | $template = $twig->loadTemplate('index'); | ||
114 | try { | ||
115 | $template->render(array()); | ||
116 | |||
117 | $this->fail(); | ||
118 | } catch (Twig_Error_Runtime $e) { | ||
119 | $this->assertEquals('Variable "foo" does not exist in "base" at line 1', $e->getMessage()); | ||
120 | $this->assertEquals(1, $e->getTemplateLine()); | ||
121 | $this->assertEquals('base', $e->getTemplateFile()); | ||
122 | } | ||
123 | } | ||
124 | |||
125 | public function testTwigExceptionAddsFileAndLineWhenMissingWithInheritanceOnDisk() | ||
126 | { | ||
127 | $loader = new Twig_Loader_Filesystem(dirname(__FILE__).'/Fixtures/errors'); | ||
128 | $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); | ||
129 | |||
130 | $template = $twig->loadTemplate('index.html'); | ||
131 | try { | ||
132 | $template->render(array()); | ||
133 | |||
134 | $this->fail(); | ||
135 | } catch (Twig_Error_Runtime $e) { | ||
136 | $this->assertEquals('Variable "foo" does not exist in "index.html" at line 3', $e->getMessage()); | ||
137 | $this->assertEquals(3, $e->getTemplateLine()); | ||
138 | $this->assertEquals('index.html', $e->getTemplateFile()); | ||
139 | } | ||
140 | |||
141 | try { | ||
142 | $template->render(array('foo' => new Twig_Tests_ErrorTest_Foo())); | ||
143 | |||
144 | $this->fail(); | ||
145 | } catch (Twig_Error_Runtime $e) { | ||
146 | $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...") in "index.html" at line 3.', $e->getMessage()); | ||
147 | $this->assertEquals(3, $e->getTemplateLine()); | ||
148 | $this->assertEquals('index.html', $e->getTemplateFile()); | ||
149 | } | ||
150 | } | ||
151 | } | ||
152 | |||
153 | class Twig_Tests_ErrorTest_Foo | ||
154 | { | ||
155 | public function bar() | ||
156 | { | ||
157 | throw new Exception('Runtime error...'); | ||
158 | } | ||
159 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php b/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php deleted file mode 100644 index 8ec6537a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php +++ /dev/null | |||
@@ -1,332 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_ExpressionParserTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | /** | ||
15 | * @expectedException Twig_Error_Syntax | ||
16 | * @dataProvider getFailingTestsForAssignment | ||
17 | */ | ||
18 | public function testCanOnlyAssignToNames($template) | ||
19 | { | ||
20 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
21 | $parser = new Twig_Parser($env); | ||
22 | |||
23 | $parser->parse($env->tokenize($template, 'index')); | ||
24 | } | ||
25 | |||
26 | public function getFailingTestsForAssignment() | ||
27 | { | ||
28 | return array( | ||
29 | array('{% set false = "foo" %}'), | ||
30 | array('{% set true = "foo" %}'), | ||
31 | array('{% set none = "foo" %}'), | ||
32 | array('{% set 3 = "foo" %}'), | ||
33 | array('{% set 1 + 2 = "foo" %}'), | ||
34 | array('{% set "bar" = "foo" %}'), | ||
35 | array('{% set %}{% endset %}') | ||
36 | ); | ||
37 | } | ||
38 | |||
39 | /** | ||
40 | * @dataProvider getTestsForArray | ||
41 | */ | ||
42 | public function testArrayExpression($template, $expected) | ||
43 | { | ||
44 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
45 | $stream = $env->tokenize($template, 'index'); | ||
46 | $parser = new Twig_Parser($env); | ||
47 | |||
48 | $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * @expectedException Twig_Error_Syntax | ||
53 | * @dataProvider getFailingTestsForArray | ||
54 | */ | ||
55 | public function testArraySyntaxError($template) | ||
56 | { | ||
57 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
58 | $parser = new Twig_Parser($env); | ||
59 | |||
60 | $parser->parse($env->tokenize($template, 'index')); | ||
61 | } | ||
62 | |||
63 | public function getFailingTestsForArray() | ||
64 | { | ||
65 | return array( | ||
66 | array('{{ [1, "a": "b"] }}'), | ||
67 | array('{{ {"a": "b", 2} }}'), | ||
68 | ); | ||
69 | } | ||
70 | |||
71 | public function getTestsForArray() | ||
72 | { | ||
73 | return array( | ||
74 | // simple array | ||
75 | array('{{ [1, 2] }}', new Twig_Node_Expression_Array(array( | ||
76 | new Twig_Node_Expression_Constant(0, 1), | ||
77 | new Twig_Node_Expression_Constant(1, 1), | ||
78 | |||
79 | new Twig_Node_Expression_Constant(1, 1), | ||
80 | new Twig_Node_Expression_Constant(2, 1), | ||
81 | ), 1), | ||
82 | ), | ||
83 | |||
84 | // array with trailing , | ||
85 | array('{{ [1, 2, ] }}', new Twig_Node_Expression_Array(array( | ||
86 | new Twig_Node_Expression_Constant(0, 1), | ||
87 | new Twig_Node_Expression_Constant(1, 1), | ||
88 | |||
89 | new Twig_Node_Expression_Constant(1, 1), | ||
90 | new Twig_Node_Expression_Constant(2, 1), | ||
91 | ), 1), | ||
92 | ), | ||
93 | |||
94 | // simple hash | ||
95 | array('{{ {"a": "b", "b": "c"} }}', new Twig_Node_Expression_Array(array( | ||
96 | new Twig_Node_Expression_Constant('a', 1), | ||
97 | new Twig_Node_Expression_Constant('b', 1), | ||
98 | |||
99 | new Twig_Node_Expression_Constant('b', 1), | ||
100 | new Twig_Node_Expression_Constant('c', 1), | ||
101 | ), 1), | ||
102 | ), | ||
103 | |||
104 | // hash with trailing , | ||
105 | array('{{ {"a": "b", "b": "c", } }}', new Twig_Node_Expression_Array(array( | ||
106 | new Twig_Node_Expression_Constant('a', 1), | ||
107 | new Twig_Node_Expression_Constant('b', 1), | ||
108 | |||
109 | new Twig_Node_Expression_Constant('b', 1), | ||
110 | new Twig_Node_Expression_Constant('c', 1), | ||
111 | ), 1), | ||
112 | ), | ||
113 | |||
114 | // hash in an array | ||
115 | array('{{ [1, {"a": "b", "b": "c"}] }}', new Twig_Node_Expression_Array(array( | ||
116 | new Twig_Node_Expression_Constant(0, 1), | ||
117 | new Twig_Node_Expression_Constant(1, 1), | ||
118 | |||
119 | new Twig_Node_Expression_Constant(1, 1), | ||
120 | new Twig_Node_Expression_Array(array( | ||
121 | new Twig_Node_Expression_Constant('a', 1), | ||
122 | new Twig_Node_Expression_Constant('b', 1), | ||
123 | |||
124 | new Twig_Node_Expression_Constant('b', 1), | ||
125 | new Twig_Node_Expression_Constant('c', 1), | ||
126 | ), 1), | ||
127 | ), 1), | ||
128 | ), | ||
129 | |||
130 | // array in a hash | ||
131 | array('{{ {"a": [1, 2], "b": "c"} }}', new Twig_Node_Expression_Array(array( | ||
132 | new Twig_Node_Expression_Constant('a', 1), | ||
133 | new Twig_Node_Expression_Array(array( | ||
134 | new Twig_Node_Expression_Constant(0, 1), | ||
135 | new Twig_Node_Expression_Constant(1, 1), | ||
136 | |||
137 | new Twig_Node_Expression_Constant(1, 1), | ||
138 | new Twig_Node_Expression_Constant(2, 1), | ||
139 | ), 1), | ||
140 | new Twig_Node_Expression_Constant('b', 1), | ||
141 | new Twig_Node_Expression_Constant('c', 1), | ||
142 | ), 1), | ||
143 | ), | ||
144 | ); | ||
145 | } | ||
146 | |||
147 | /** | ||
148 | * @expectedException Twig_Error_Syntax | ||
149 | */ | ||
150 | public function testStringExpressionDoesNotConcatenateTwoConsecutiveStrings() | ||
151 | { | ||
152 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); | ||
153 | $stream = $env->tokenize('{{ "a" "b" }}', 'index'); | ||
154 | $parser = new Twig_Parser($env); | ||
155 | |||
156 | $parser->parse($stream); | ||
157 | } | ||
158 | |||
159 | /** | ||
160 | * @dataProvider getTestsForString | ||
161 | */ | ||
162 | public function testStringExpression($template, $expected) | ||
163 | { | ||
164 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0)); | ||
165 | $stream = $env->tokenize($template, 'index'); | ||
166 | $parser = new Twig_Parser($env); | ||
167 | |||
168 | $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); | ||
169 | } | ||
170 | |||
171 | public function getTestsForString() | ||
172 | { | ||
173 | return array( | ||
174 | array( | ||
175 | '{{ "foo" }}', new Twig_Node_Expression_Constant('foo', 1), | ||
176 | ), | ||
177 | array( | ||
178 | '{{ "foo #{bar}" }}', new Twig_Node_Expression_Binary_Concat( | ||
179 | new Twig_Node_Expression_Constant('foo ', 1), | ||
180 | new Twig_Node_Expression_Name('bar', 1), | ||
181 | 1 | ||
182 | ), | ||
183 | ), | ||
184 | array( | ||
185 | '{{ "foo #{bar} baz" }}', new Twig_Node_Expression_Binary_Concat( | ||
186 | new Twig_Node_Expression_Binary_Concat( | ||
187 | new Twig_Node_Expression_Constant('foo ', 1), | ||
188 | new Twig_Node_Expression_Name('bar', 1), | ||
189 | 1 | ||
190 | ), | ||
191 | new Twig_Node_Expression_Constant(' baz', 1), | ||
192 | 1 | ||
193 | ) | ||
194 | ), | ||
195 | |||
196 | array( | ||
197 | '{{ "foo #{"foo #{bar} baz"} baz" }}', new Twig_Node_Expression_Binary_Concat( | ||
198 | new Twig_Node_Expression_Binary_Concat( | ||
199 | new Twig_Node_Expression_Constant('foo ', 1), | ||
200 | new Twig_Node_Expression_Binary_Concat( | ||
201 | new Twig_Node_Expression_Binary_Concat( | ||
202 | new Twig_Node_Expression_Constant('foo ', 1), | ||
203 | new Twig_Node_Expression_Name('bar', 1), | ||
204 | 1 | ||
205 | ), | ||
206 | new Twig_Node_Expression_Constant(' baz', 1), | ||
207 | 1 | ||
208 | ), | ||
209 | 1 | ||
210 | ), | ||
211 | new Twig_Node_Expression_Constant(' baz', 1), | ||
212 | 1 | ||
213 | ), | ||
214 | ), | ||
215 | ); | ||
216 | } | ||
217 | |||
218 | /** | ||
219 | * @expectedException Twig_Error_Syntax | ||
220 | */ | ||
221 | public function testAttributeCallDoesNotSupportNamedArguments() | ||
222 | { | ||
223 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
224 | $parser = new Twig_Parser($env); | ||
225 | |||
226 | $parser->parse($env->tokenize('{{ foo.bar(name="Foo") }}', 'index')); | ||
227 | } | ||
228 | |||
229 | /** | ||
230 | * @expectedException Twig_Error_Syntax | ||
231 | */ | ||
232 | public function testMacroCallDoesNotSupportNamedArguments() | ||
233 | { | ||
234 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
235 | $parser = new Twig_Parser($env); | ||
236 | |||
237 | $parser->parse($env->tokenize('{% from _self import foo %}{% macro foo() %}{% endmacro %}{{ foo(name="Foo") }}', 'index')); | ||
238 | } | ||
239 | |||
240 | /** | ||
241 | * @expectedException Twig_Error_Syntax | ||
242 | * @expectedExceptionMessage An argument must be a name. Unexpected token "string" of value "a" ("name" expected) in "index" at line 1 | ||
243 | */ | ||
244 | public function testMacroDefinitionDoesNotSupportNonNameVariableName() | ||
245 | { | ||
246 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
247 | $parser = new Twig_Parser($env); | ||
248 | |||
249 | $parser->parse($env->tokenize('{% macro foo("a") %}{% endmacro %}', 'index')); | ||
250 | } | ||
251 | |||
252 | /** | ||
253 | * @expectedException Twig_Error_Syntax | ||
254 | * @expectedExceptionMessage A default value for an argument must be a constant (a boolean, a string, a number, or an array) in "index" at line 1 | ||
255 | * @dataProvider getMacroDefinitionDoesNotSupportNonConstantDefaultValues | ||
256 | */ | ||
257 | public function testMacroDefinitionDoesNotSupportNonConstantDefaultValues($template) | ||
258 | { | ||
259 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
260 | $parser = new Twig_Parser($env); | ||
261 | |||
262 | $parser->parse($env->tokenize($template, 'index')); | ||
263 | } | ||
264 | |||
265 | public function getMacroDefinitionDoesNotSupportNonConstantDefaultValues() | ||
266 | { | ||
267 | return array( | ||
268 | array('{% macro foo(name = "a #{foo} a") %}{% endmacro %}'), | ||
269 | array('{% macro foo(name = [["b", "a #{foo} a"]]) %}{% endmacro %}'), | ||
270 | ); | ||
271 | } | ||
272 | |||
273 | /** | ||
274 | * @dataProvider getMacroDefinitionSupportsConstantDefaultValues | ||
275 | */ | ||
276 | public function testMacroDefinitionSupportsConstantDefaultValues($template) | ||
277 | { | ||
278 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
279 | $parser = new Twig_Parser($env); | ||
280 | |||
281 | $parser->parse($env->tokenize($template, 'index')); | ||
282 | } | ||
283 | |||
284 | public function getMacroDefinitionSupportsConstantDefaultValues() | ||
285 | { | ||
286 | return array( | ||
287 | array('{% macro foo(name = "aa") %}{% endmacro %}'), | ||
288 | array('{% macro foo(name = 12) %}{% endmacro %}'), | ||
289 | array('{% macro foo(name = true) %}{% endmacro %}'), | ||
290 | array('{% macro foo(name = ["a"]) %}{% endmacro %}'), | ||
291 | array('{% macro foo(name = [["a"]]) %}{% endmacro %}'), | ||
292 | array('{% macro foo(name = {a: "a"}) %}{% endmacro %}'), | ||
293 | array('{% macro foo(name = {a: {b: "a"}}) %}{% endmacro %}'), | ||
294 | ); | ||
295 | } | ||
296 | |||
297 | /** | ||
298 | * @expectedException Twig_Error_Syntax | ||
299 | * @expectedExceptionMessage The function "cycl" does not exist. Did you mean "cycle" in "index" at line 1 | ||
300 | */ | ||
301 | public function testUnknownFunction() | ||
302 | { | ||
303 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
304 | $parser = new Twig_Parser($env); | ||
305 | |||
306 | $parser->parse($env->tokenize('{{ cycl() }}', 'index')); | ||
307 | } | ||
308 | |||
309 | /** | ||
310 | * @expectedException Twig_Error_Syntax | ||
311 | * @expectedExceptionMessage The filter "lowe" does not exist. Did you mean "lower" in "index" at line 1 | ||
312 | */ | ||
313 | public function testUnknownFilter() | ||
314 | { | ||
315 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
316 | $parser = new Twig_Parser($env); | ||
317 | |||
318 | $parser->parse($env->tokenize('{{ 1|lowe }}', 'index')); | ||
319 | } | ||
320 | |||
321 | /** | ||
322 | * @expectedException Twig_Error_Syntax | ||
323 | * @expectedExceptionMessage The test "nul" does not exist. Did you mean "null" in "index" at line 1 | ||
324 | */ | ||
325 | public function testUnknownTest() | ||
326 | { | ||
327 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
328 | $parser = new Twig_Parser($env); | ||
329 | |||
330 | $parser->parse($env->tokenize('{{ 1 is nul }}', 'index')); | ||
331 | } | ||
332 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php b/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php deleted file mode 100644 index 5743e343..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Extension_CoreTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | /** | ||
15 | * @dataProvider getRandomFunctionTestData | ||
16 | */ | ||
17 | public function testRandomFunction($value, $expectedInArray) | ||
18 | { | ||
19 | $env = new Twig_Environment(); | ||
20 | |||
21 | for ($i = 0; $i < 100; $i++) { | ||
22 | $this->assertTrue(in_array(twig_random($env, $value), $expectedInArray, true)); // assertContains() would not consider the type | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function getRandomFunctionTestData() | ||
27 | { | ||
28 | return array( | ||
29 | array( // array | ||
30 | array('apple', 'orange', 'citrus'), | ||
31 | array('apple', 'orange', 'citrus'), | ||
32 | ), | ||
33 | array( // Traversable | ||
34 | new ArrayObject(array('apple', 'orange', 'citrus')), | ||
35 | array('apple', 'orange', 'citrus'), | ||
36 | ), | ||
37 | array( // unicode string | ||
38 | 'Ä€é', | ||
39 | array('Ä', '€', 'é'), | ||
40 | ), | ||
41 | array( // numeric but string | ||
42 | '123', | ||
43 | array('1', '2', '3'), | ||
44 | ), | ||
45 | array( // integer | ||
46 | 5, | ||
47 | range(0, 5, 1), | ||
48 | ), | ||
49 | array( // float | ||
50 | 5.9, | ||
51 | range(0, 5, 1), | ||
52 | ), | ||
53 | array( // negative | ||
54 | -2, | ||
55 | array(0, -1, -2), | ||
56 | ), | ||
57 | ); | ||
58 | } | ||
59 | |||
60 | public function testRandomFunctionWithoutParameter() | ||
61 | { | ||
62 | $max = mt_getrandmax(); | ||
63 | |||
64 | for ($i = 0; $i < 100; $i++) { | ||
65 | $val = twig_random(new Twig_Environment()); | ||
66 | $this->assertTrue(is_int($val) && $val >= 0 && $val <= $max); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | public function testRandomFunctionReturnsAsIs() | ||
71 | { | ||
72 | $this->assertSame('', twig_random(new Twig_Environment(), '')); | ||
73 | $this->assertSame('', twig_random(new Twig_Environment(null, array('charset' => null)), '')); | ||
74 | |||
75 | $instance = new stdClass(); | ||
76 | $this->assertSame($instance, twig_random(new Twig_Environment(), $instance)); | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * @expectedException Twig_Error_Runtime | ||
81 | */ | ||
82 | public function testRandomFunctionOfEmptyArrayThrowsException() | ||
83 | { | ||
84 | twig_random(new Twig_Environment(), array()); | ||
85 | } | ||
86 | |||
87 | public function testRandomFunctionOnNonUTF8String() | ||
88 | { | ||
89 | if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) { | ||
90 | $this->markTestSkipped('needs iconv or mbstring'); | ||
91 | } | ||
92 | |||
93 | $twig = new Twig_Environment(); | ||
94 | $twig->setCharset('ISO-8859-1'); | ||
95 | |||
96 | $text = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8'); | ||
97 | for ($i = 0; $i < 30; $i++) { | ||
98 | $rand = twig_random($twig, $text); | ||
99 | $this->assertTrue(in_array(twig_convert_encoding($rand, 'UTF-8', 'ISO-8859-1'), array('Ä', 'é'), true)); | ||
100 | } | ||
101 | } | ||
102 | |||
103 | public function testReverseFilterOnNonUTF8String() | ||
104 | { | ||
105 | if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) { | ||
106 | $this->markTestSkipped('needs iconv or mbstring'); | ||
107 | } | ||
108 | |||
109 | $twig = new Twig_Environment(); | ||
110 | $twig->setCharset('ISO-8859-1'); | ||
111 | |||
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'); | ||
114 | |||
115 | $this->assertEquals($output, 'éÄ'); | ||
116 | } | ||
117 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php b/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php deleted file mode 100644 index 72253c88..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php +++ /dev/null | |||
@@ -1,212 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Extension_SandboxTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | protected static $params, $templates; | ||
15 | |||
16 | public function setUp() | ||
17 | { | ||
18 | self::$params = array( | ||
19 | 'name' => 'Fabien', | ||
20 | 'obj' => new FooObject(), | ||
21 | 'arr' => array('obj' => new FooObject()), | ||
22 | ); | ||
23 | |||
24 | self::$templates = array( | ||
25 | '1_basic1' => '{{ obj.foo }}', | ||
26 | '1_basic2' => '{{ name|upper }}', | ||
27 | '1_basic3' => '{% if name %}foo{% endif %}', | ||
28 | '1_basic4' => '{{ obj.bar }}', | ||
29 | '1_basic5' => '{{ obj }}', | ||
30 | '1_basic6' => '{{ arr.obj }}', | ||
31 | '1_basic7' => '{{ cycle(["foo","bar"], 1) }}', | ||
32 | '1_basic8' => '{{ obj.getfoobar }}{{ obj.getFooBar }}', | ||
33 | '1_basic' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', | ||
34 | '1_layout' => '{% block content %}{% endblock %}', | ||
35 | '1_child' => '{% extends "1_layout" %}{% block content %}{{ "a"|json_encode }}{% endblock %}', | ||
36 | ); | ||
37 | } | ||
38 | |||
39 | /** | ||
40 | * @expectedException Twig_Sandbox_SecurityError | ||
41 | * @expectedExceptionMessage Filter "json_encode" is not allowed in "1_child". | ||
42 | */ | ||
43 | public function testSandboxWithInheritance() | ||
44 | { | ||
45 | $twig = $this->getEnvironment(true, array(), self::$templates, array('block')); | ||
46 | $twig->loadTemplate('1_child')->render(array()); | ||
47 | } | ||
48 | |||
49 | public function testSandboxGloballySet() | ||
50 | { | ||
51 | $twig = $this->getEnvironment(false, array(), self::$templates); | ||
52 | $this->assertEquals('FOO', $twig->loadTemplate('1_basic')->render(self::$params), 'Sandbox does nothing if it is disabled globally'); | ||
53 | |||
54 | $twig = $this->getEnvironment(true, array(), self::$templates); | ||
55 | try { | ||
56 | $twig->loadTemplate('1_basic1')->render(self::$params); | ||
57 | $this->fail('Sandbox throws a SecurityError exception if an unallowed method is called'); | ||
58 | } catch (Twig_Sandbox_SecurityError $e) { | ||
59 | } | ||
60 | |||
61 | $twig = $this->getEnvironment(true, array(), self::$templates); | ||
62 | try { | ||
63 | $twig->loadTemplate('1_basic2')->render(self::$params); | ||
64 | $this->fail('Sandbox throws a SecurityError exception if an unallowed filter is called'); | ||
65 | } catch (Twig_Sandbox_SecurityError $e) { | ||
66 | } | ||
67 | |||
68 | $twig = $this->getEnvironment(true, array(), self::$templates); | ||
69 | try { | ||
70 | $twig->loadTemplate('1_basic3')->render(self::$params); | ||
71 | $this->fail('Sandbox throws a SecurityError exception if an unallowed tag is used in the template'); | ||
72 | } catch (Twig_Sandbox_SecurityError $e) { | ||
73 | } | ||
74 | |||
75 | $twig = $this->getEnvironment(true, array(), self::$templates); | ||
76 | try { | ||
77 | $twig->loadTemplate('1_basic4')->render(self::$params); | ||
78 | $this->fail('Sandbox throws a SecurityError exception if an unallowed property is called in the template'); | ||
79 | } catch (Twig_Sandbox_SecurityError $e) { | ||
80 | } | ||
81 | |||
82 | $twig = $this->getEnvironment(true, array(), self::$templates); | ||
83 | try { | ||
84 | $twig->loadTemplate('1_basic5')->render(self::$params); | ||
85 | $this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); | ||
86 | } catch (Twig_Sandbox_SecurityError $e) { | ||
87 | } | ||
88 | |||
89 | $twig = $this->getEnvironment(true, array(), self::$templates); | ||
90 | try { | ||
91 | $twig->loadTemplate('1_basic6')->render(self::$params); | ||
92 | $this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); | ||
93 | } catch (Twig_Sandbox_SecurityError $e) { | ||
94 | } | ||
95 | |||
96 | $twig = $this->getEnvironment(true, array(), self::$templates); | ||
97 | try { | ||
98 | $twig->loadTemplate('1_basic7')->render(self::$params); | ||
99 | $this->fail('Sandbox throws a SecurityError exception if an unallowed function is called in the template'); | ||
100 | } catch (Twig_Sandbox_SecurityError $e) { | ||
101 | } | ||
102 | |||
103 | $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array('FooObject' => 'foo')); | ||
104 | FooObject::reset(); | ||
105 | $this->assertEquals('foo', $twig->loadTemplate('1_basic1')->render(self::$params), 'Sandbox allow some methods'); | ||
106 | $this->assertEquals(1, FooObject::$called['foo'], 'Sandbox only calls method once'); | ||
107 | |||
108 | $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array('FooObject' => '__toString')); | ||
109 | FooObject::reset(); | ||
110 | $this->assertEquals('foo', $twig->loadTemplate('1_basic5')->render(self::$params), 'Sandbox allow some methods'); | ||
111 | $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); | ||
112 | |||
113 | $twig = $this->getEnvironment(true, array(), self::$templates, array(), array('upper')); | ||
114 | $this->assertEquals('FABIEN', $twig->loadTemplate('1_basic2')->render(self::$params), 'Sandbox allow some filters'); | ||
115 | |||
116 | $twig = $this->getEnvironment(true, array(), self::$templates, array('if')); | ||
117 | $this->assertEquals('foo', $twig->loadTemplate('1_basic3')->render(self::$params), 'Sandbox allow some tags'); | ||
118 | |||
119 | $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array(), array('FooObject' => 'bar')); | ||
120 | $this->assertEquals('bar', $twig->loadTemplate('1_basic4')->render(self::$params), 'Sandbox allow some properties'); | ||
121 | |||
122 | $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array(), array(), array('cycle')); | ||
123 | $this->assertEquals('bar', $twig->loadTemplate('1_basic7')->render(self::$params), 'Sandbox allow some functions'); | ||
124 | |||
125 | foreach (array('getfoobar', 'getFoobar', 'getFooBar') as $name) { | ||
126 | $twig = $this->getEnvironment(true, array(), self::$templates, array(), array(), array('FooObject' => $name)); | ||
127 | FooObject::reset(); | ||
128 | $this->assertEquals('foobarfoobar', $twig->loadTemplate('1_basic8')->render(self::$params), 'Sandbox allow methods in a case-insensitive way'); | ||
129 | $this->assertEquals(2, FooObject::$called['getFooBar'], 'Sandbox only calls method once'); | ||
130 | } | ||
131 | } | ||
132 | |||
133 | public function testSandboxLocallySetForAnInclude() | ||
134 | { | ||
135 | self::$templates = array( | ||
136 | '2_basic' => '{{ obj.foo }}{% include "2_included" %}{{ obj.foo }}', | ||
137 | '2_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', | ||
138 | ); | ||
139 | |||
140 | $twig = $this->getEnvironment(false, array(), self::$templates); | ||
141 | $this->assertEquals('fooFOOfoo', $twig->loadTemplate('2_basic')->render(self::$params), 'Sandbox does nothing if disabled globally and sandboxed not used for the include'); | ||
142 | |||
143 | self::$templates = array( | ||
144 | '3_basic' => '{{ obj.foo }}{% sandbox %}{% include "3_included" %}{% endsandbox %}{{ obj.foo }}', | ||
145 | '3_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', | ||
146 | ); | ||
147 | |||
148 | $twig = $this->getEnvironment(true, array(), self::$templates); | ||
149 | try { | ||
150 | $twig->loadTemplate('3_basic')->render(self::$params); | ||
151 | $this->fail('Sandbox throws a SecurityError exception when the included file is sandboxed'); | ||
152 | } catch (Twig_Sandbox_SecurityError $e) { | ||
153 | } | ||
154 | } | ||
155 | |||
156 | public function testMacrosInASandbox() | ||
157 | { | ||
158 | $twig = $this->getEnvironment(true, array('autoescape' => true), array('index' => <<<EOF | ||
159 | {%- import _self as macros %} | ||
160 | |||
161 | {%- macro test(text) %}<p>{{ text }}</p>{% endmacro %} | ||
162 | |||
163 | {{- macros.test('username') }} | ||
164 | EOF | ||
165 | ), array('macro', 'import'), array('escape')); | ||
166 | |||
167 | $this->assertEquals('<p>username</p>', $twig->loadTemplate('index')->render(array())); | ||
168 | } | ||
169 | |||
170 | protected function getEnvironment($sandboxed, $options, $templates, $tags = array(), $filters = array(), $methods = array(), $properties = array(), $functions = array()) | ||
171 | { | ||
172 | $loader = new Twig_Loader_Array($templates); | ||
173 | $twig = new Twig_Environment($loader, array_merge(array('debug' => true, 'cache' => false, 'autoescape' => false), $options)); | ||
174 | $policy = new Twig_Sandbox_SecurityPolicy($tags, $filters, $methods, $properties, $functions); | ||
175 | $twig->addExtension(new Twig_Extension_Sandbox($policy, $sandboxed)); | ||
176 | |||
177 | return $twig; | ||
178 | } | ||
179 | } | ||
180 | |||
181 | class FooObject | ||
182 | { | ||
183 | public static $called = array('__toString' => 0, 'foo' => 0, 'getFooBar' => 0); | ||
184 | |||
185 | public $bar = 'bar'; | ||
186 | |||
187 | public static function reset() | ||
188 | { | ||
189 | self::$called = array('__toString' => 0, 'foo' => 0, 'getFooBar' => 0); | ||
190 | } | ||
191 | |||
192 | public function __toString() | ||
193 | { | ||
194 | ++self::$called['__toString']; | ||
195 | |||
196 | return 'foo'; | ||
197 | } | ||
198 | |||
199 | public function foo() | ||
200 | { | ||
201 | ++self::$called['foo']; | ||
202 | |||
203 | return 'foo'; | ||
204 | } | ||
205 | |||
206 | public function getFooBar() | ||
207 | { | ||
208 | ++self::$called['getFooBar']; | ||
209 | |||
210 | return 'foobar'; | ||
211 | } | ||
212 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php b/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php deleted file mode 100644 index 8efc948f..00000000 --- a/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | class Twig_Tests_FileCachingTest extends PHPUnit_Framework_TestCase | ||
4 | { | ||
5 | protected $fileName; | ||
6 | protected $env; | ||
7 | protected $tmpDir; | ||
8 | |||
9 | public function setUp() | ||
10 | { | ||
11 | $this->tmpDir = sys_get_temp_dir().'/TwigTests'; | ||
12 | if (!file_exists($this->tmpDir)) { | ||
13 | @mkdir($this->tmpDir, 0777, true); | ||
14 | } | ||
15 | |||
16 | if (!is_writable($this->tmpDir)) { | ||
17 | $this->markTestSkipped(sprintf('Unable to run the tests as "%s" is not writable.', $this->tmpDir)); | ||
18 | } | ||
19 | |||
20 | $this->env = new Twig_Environment(new Twig_Loader_String(), array('cache' => $this->tmpDir)); | ||
21 | } | ||
22 | |||
23 | public function tearDown() | ||
24 | { | ||
25 | if ($this->fileName) { | ||
26 | unlink($this->fileName); | ||
27 | } | ||
28 | |||
29 | $this->removeDir($this->tmpDir); | ||
30 | } | ||
31 | |||
32 | public function testWritingCacheFiles() | ||
33 | { | ||
34 | $name = 'This is just text.'; | ||
35 | $template = $this->env->loadTemplate($name); | ||
36 | $cacheFileName = $this->env->getCacheFilename($name); | ||
37 | |||
38 | $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); | ||
39 | $this->fileName = $cacheFileName; | ||
40 | } | ||
41 | |||
42 | public function testClearingCacheFiles() | ||
43 | { | ||
44 | $name = 'I will be deleted.'; | ||
45 | $template = $this->env->loadTemplate($name); | ||
46 | $cacheFileName = $this->env->getCacheFilename($name); | ||
47 | |||
48 | $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); | ||
49 | $this->env->clearCacheFiles(); | ||
50 | $this->assertFalse(file_exists($cacheFileName), 'Cache file was not cleared.'); | ||
51 | } | ||
52 | |||
53 | private function removeDir($target) | ||
54 | { | ||
55 | $fp = opendir($target); | ||
56 | while (false !== $file = readdir($fp)) { | ||
57 | if (in_array($file, array('.', '..'))) { | ||
58 | continue; | ||
59 | } | ||
60 | |||
61 | if (is_dir($target.'/'.$file)) { | ||
62 | self::removeDir($target.'/'.$file); | ||
63 | } else { | ||
64 | unlink($target.'/'.$file); | ||
65 | } | ||
66 | } | ||
67 | closedir($fp); | ||
68 | rmdir($target); | ||
69 | } | ||
70 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html b/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html deleted file mode 100644 index cb0dbe44..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | {% block content %}{% endblock %} | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html b/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html deleted file mode 100644 index df57c822..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | {% extends 'base.html' %} | ||
2 | {% block content %} | ||
3 | {{ foo.bar }} | ||
4 | {% endblock %} | ||
5 | {% block foo %} | ||
6 | {{ foo.bar }} | ||
7 | {% endblock %} | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test deleted file mode 100644 index 02245e93..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Exception for an unclosed tag | ||
3 | --TEMPLATE-- | ||
4 | {% block foo %} | ||
5 | {% if foo %} | ||
6 | |||
7 | |||
8 | |||
9 | |||
10 | {% for i in fo %} | ||
11 | |||
12 | |||
13 | |||
14 | {% endfor %} | ||
15 | |||
16 | |||
17 | |||
18 | {% endblock %} | ||
19 | --EXCEPTION-- | ||
20 | Twig_Error_Syntax: Unexpected tag name "endblock" (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test deleted file mode 100644 index c69b1192..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports array notation | ||
3 | --TEMPLATE-- | ||
4 | {# empty array #} | ||
5 | {{ []|join(',') }} | ||
6 | |||
7 | {{ [1, 2]|join(',') }} | ||
8 | {{ ['foo', "bar"]|join(',') }} | ||
9 | {{ {0: 1, 'foo': 'bar'}|join(',') }} | ||
10 | {{ {0: 1, 'foo': 'bar'}|keys|join(',') }} | ||
11 | |||
12 | {{ {0: 1, foo: 'bar'}|join(',') }} | ||
13 | {{ {0: 1, foo: 'bar'}|keys|join(',') }} | ||
14 | |||
15 | {# nested arrays #} | ||
16 | {% set a = [1, 2, [1, 2], {'foo': {'foo': 'bar'}}] %} | ||
17 | {{ a[2]|join(',') }} | ||
18 | {{ a[3]["foo"]|join(',') }} | ||
19 | |||
20 | {# works even if [] is used inside the array #} | ||
21 | {{ [foo[bar]]|join(',') }} | ||
22 | |||
23 | {# elements can be any expression #} | ||
24 | {{ ['foo'|upper, bar|upper, bar == foo]|join(',') }} | ||
25 | |||
26 | {# arrays can have a trailing , like in PHP #} | ||
27 | {{ | ||
28 | [ | ||
29 | 1, | ||
30 | 2, | ||
31 | ]|join(',') | ||
32 | }} | ||
33 | |||
34 | {# keys can be any expression #} | ||
35 | {% set a = 1 %} | ||
36 | {% set b = "foo" %} | ||
37 | {% set ary = { (a): 'a', (b): 'b', 'c': 'c', (a ~ b): 'd' } %} | ||
38 | {{ ary|keys|join(',') }} | ||
39 | {{ ary|join(',') }} | ||
40 | --DATA-- | ||
41 | return array('bar' => 'bar', 'foo' => array('bar' => 'bar')) | ||
42 | --EXPECT-- | ||
43 | 1,2 | ||
44 | foo,bar | ||
45 | 1,bar | ||
46 | 0,foo | ||
47 | |||
48 | 1,bar | ||
49 | 0,foo | ||
50 | |||
51 | 1,2 | ||
52 | bar | ||
53 | |||
54 | bar | ||
55 | |||
56 | FOO,BAR, | ||
57 | |||
58 | 1,2 | ||
59 | |||
60 | 1,foo,c,1foo | ||
61 | a,b,c,d | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test deleted file mode 100644 index f3df328f..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports method calls | ||
3 | --TEMPLATE-- | ||
4 | {{ items.foo }} | ||
5 | {{ items['foo'] }} | ||
6 | {{ items[foo] }} | ||
7 | {{ items[items[foo]] }} | ||
8 | --DATA-- | ||
9 | return array('foo' => 'bar', 'items' => array('foo' => 'bar', 'bar' => 'foo')) | ||
10 | --EXPECT-- | ||
11 | bar | ||
12 | bar | ||
13 | foo | ||
14 | bar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test deleted file mode 100644 index f5e68456..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports binary operations (+, -, *, /, ~, %, and, or) | ||
3 | --TEMPLATE-- | ||
4 | {{ 1 + 1 }} | ||
5 | {{ 2 - 1 }} | ||
6 | {{ 2 * 2 }} | ||
7 | {{ 2 / 2 }} | ||
8 | {{ 3 % 2 }} | ||
9 | {{ 1 and 1 }} | ||
10 | {{ 1 and 0 }} | ||
11 | {{ 0 and 1 }} | ||
12 | {{ 0 and 0 }} | ||
13 | {{ 1 or 1 }} | ||
14 | {{ 1 or 0 }} | ||
15 | {{ 0 or 1 }} | ||
16 | {{ 0 or 0 }} | ||
17 | {{ 0 or 1 and 0 }} | ||
18 | {{ 1 or 0 and 1 }} | ||
19 | {{ "foo" ~ "bar" }} | ||
20 | {{ foo ~ "bar" }} | ||
21 | {{ "foo" ~ bar }} | ||
22 | {{ foo ~ bar }} | ||
23 | {{ 20 // 7 }} | ||
24 | --DATA-- | ||
25 | return array('foo' => 'bar', 'bar' => 'foo') | ||
26 | --EXPECT-- | ||
27 | 2 | ||
28 | 1 | ||
29 | 4 | ||
30 | 1 | ||
31 | 1 | ||
32 | 1 | ||
33 | |||
34 | |||
35 | |||
36 | 1 | ||
37 | 1 | ||
38 | 1 | ||
39 | |||
40 | |||
41 | 1 | ||
42 | foobar | ||
43 | barbar | ||
44 | foofoo | ||
45 | barfoo | ||
46 | 2 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test deleted file mode 100644 index 7b56b761..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports bitwise operations | ||
3 | --TEMPLATE-- | ||
4 | {{ 1 b-and 5 }} | ||
5 | {{ 1 b-or 5 }} | ||
6 | {{ 1 b-xor 5 }} | ||
7 | {{ (1 and 0 b-or 0) is sameas(1 and (0 b-or 0)) ? 'ok' : 'ko' }} | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXPECT-- | ||
11 | 1 | ||
12 | 5 | ||
13 | 4 | ||
14 | ok | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test deleted file mode 100644 index 726b8507..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports comparison operators (==, !=, <, >, >=, <=) | ||
3 | --TEMPLATE-- | ||
4 | {{ 1 > 2 }}/{{ 1 > 1 }}/{{ 1 >= 2 }}/{{ 1 >= 1 }} | ||
5 | {{ 1 < 2 }}/{{ 1 < 1 }}/{{ 1 <= 2 }}/{{ 1 <= 1 }} | ||
6 | {{ 1 == 1 }}/{{ 1 == 2 }} | ||
7 | {{ 1 != 1 }}/{{ 1 != 2 }} | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXPECT-- | ||
11 | ///1 | ||
12 | 1//1/1 | ||
13 | 1/ | ||
14 | /1 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test deleted file mode 100644 index 9cd0676c..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports the .. operator | ||
3 | --TEMPLATE-- | ||
4 | {% for i in 0..10 %}{{ i }} {% endfor %} | ||
5 | |||
6 | {% for letter in 'a'..'z' %}{{ letter }} {% endfor %} | ||
7 | |||
8 | {% for letter in 'a'|upper..'z'|upper %}{{ letter }} {% endfor %} | ||
9 | |||
10 | {% for i in foo[0]..foo[1] %}{{ i }} {% endfor %} | ||
11 | |||
12 | {% for i in 0 + 1 .. 10 - 1 %}{{ i }} {% endfor %} | ||
13 | --DATA-- | ||
14 | return array('foo' => array(1, 10)) | ||
15 | --EXPECT-- | ||
16 | 0 1 2 3 4 5 6 7 8 9 10 | ||
17 | a b c d e f g h i j k l m n o p q r s t u v w x y z | ||
18 | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | ||
19 | 1 2 3 4 5 6 7 8 9 10 | ||
20 | 1 2 3 4 5 6 7 8 9 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test deleted file mode 100644 index 79f8e0b0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports grouping of expressions | ||
3 | --TEMPLATE-- | ||
4 | {{ (2 + 2) / 2 }} | ||
5 | --DATA-- | ||
6 | return array() | ||
7 | --EXPECT-- | ||
8 | 2 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test deleted file mode 100644 index 7ae3bae9..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports literals | ||
3 | --TEMPLATE-- | ||
4 | 1 {{ true }} | ||
5 | 2 {{ TRUE }} | ||
6 | 3 {{ false }} | ||
7 | 4 {{ FALSE }} | ||
8 | 5 {{ none }} | ||
9 | 6 {{ NONE }} | ||
10 | 7 {{ null }} | ||
11 | 8 {{ NULL }} | ||
12 | --DATA-- | ||
13 | return array() | ||
14 | --EXPECT-- | ||
15 | 1 1 | ||
16 | 2 1 | ||
17 | 3 | ||
18 | 4 | ||
19 | 5 | ||
20 | 6 | ||
21 | 7 | ||
22 | 8 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test deleted file mode 100644 index 159db96f..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports __call() for attributes | ||
3 | --TEMPLATE-- | ||
4 | {{ foo.foo }} | ||
5 | {{ foo.bar }} | ||
6 | --DATA-- | ||
7 | class TestClassForMagicCallAttributes | ||
8 | { | ||
9 | public function getBar() | ||
10 | { | ||
11 | return 'bar_from_getbar'; | ||
12 | } | ||
13 | |||
14 | public function __call($method, $arguments) | ||
15 | { | ||
16 | if ('foo' === $method) | ||
17 | { | ||
18 | return 'foo_from_call'; | ||
19 | } | ||
20 | |||
21 | return false; | ||
22 | } | ||
23 | } | ||
24 | return array('foo' => new TestClassForMagicCallAttributes()) | ||
25 | --EXPECT-- | ||
26 | foo_from_call | ||
27 | bar_from_getbar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test deleted file mode 100644 index 5f801e63..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports method calls | ||
3 | --TEMPLATE-- | ||
4 | {{ items.foo.foo }} | ||
5 | {{ items.foo.getFoo() }} | ||
6 | {{ items.foo.bar }} | ||
7 | {{ items.foo['bar'] }} | ||
8 | {{ items.foo.bar('a', 43) }} | ||
9 | {{ items.foo.bar(foo) }} | ||
10 | {{ items.foo.self.foo() }} | ||
11 | {{ items.foo.is }} | ||
12 | {{ items.foo.in }} | ||
13 | {{ items.foo.not }} | ||
14 | --DATA-- | ||
15 | return array('foo' => 'bar', 'items' => array('foo' => new TwigTestFoo(), 'bar' => 'foo')) | ||
16 | --CONFIG-- | ||
17 | return array('strict_variables' => false) | ||
18 | --EXPECT-- | ||
19 | foo | ||
20 | foo | ||
21 | bar | ||
22 | |||
23 | bar_a-43 | ||
24 | bar_bar | ||
25 | foo | ||
26 | is | ||
27 | in | ||
28 | not | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test deleted file mode 100644 index 542c3504..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig parses postfix expressions | ||
3 | --TEMPLATE-- | ||
4 | {% import _self as macros %} | ||
5 | |||
6 | {% macro foo() %}foo{% endmacro %} | ||
7 | |||
8 | {{ 'a' }} | ||
9 | {{ 'a'|upper }} | ||
10 | {{ ('a')|upper }} | ||
11 | {{ -1|upper }} | ||
12 | {{ macros.foo() }} | ||
13 | {{ (macros).foo() }} | ||
14 | --DATA-- | ||
15 | return array(); | ||
16 | --EXPECT-- | ||
17 | a | ||
18 | A | ||
19 | A | ||
20 | -1 | ||
21 | foo | ||
22 | foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test deleted file mode 100644 index a9116613..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports string interpolation | ||
3 | --TEMPLATE-- | ||
4 | {{ "foo #{"foo #{bar} baz"} baz" }} | ||
5 | {{ "foo #{bar}#{bar} baz" }} | ||
6 | --DATA-- | ||
7 | return array('bar' => 'BAR'); | ||
8 | --EXPECT-- | ||
9 | foo foo BAR baz baz | ||
10 | foo BARBAR baz | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test deleted file mode 100644 index 0e6fa96e..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports the ternary operator | ||
3 | --TEMPLATE-- | ||
4 | {{ 1 ? 'YES' : 'NO' }} | ||
5 | {{ 0 ? 'YES' : 'NO' }} | ||
6 | {{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }} | ||
7 | {{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }} | ||
8 | {{ 1 == 1 ? 'foo<br />':'' }} | ||
9 | {{ foo ~ (bar ? ('-' ~ bar) : '') }} | ||
10 | --DATA-- | ||
11 | return array('foo' => 'foo', 'bar' => 'bar') | ||
12 | --EXPECT-- | ||
13 | YES | ||
14 | NO | ||
15 | YES1 | ||
16 | NO1 | ||
17 | foo<br /> | ||
18 | foo-bar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test deleted file mode 100644 index fdc660fc..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports the ternary operator | ||
3 | --TEMPLATE-- | ||
4 | {{ 1 ? 'YES' }} | ||
5 | {{ 0 ? 'YES' }} | ||
6 | --DATA-- | ||
7 | return array() | ||
8 | --EXPECT-- | ||
9 | YES | ||
10 | |||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test deleted file mode 100644 index 9057e837..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports the ternary operator | ||
3 | --TEMPLATE-- | ||
4 | {{ 'YES' ?: 'NO' }} | ||
5 | {{ 0 ?: 'NO' }} | ||
6 | --DATA-- | ||
7 | return array() | ||
8 | --EXPECT-- | ||
9 | YES | ||
10 | NO | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test deleted file mode 100644 index b79219a2..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports unary operators (not, -, +) | ||
3 | --TEMPLATE-- | ||
4 | {{ not 1 }}/{{ not 0 }} | ||
5 | {{ +1 + 1 }}/{{ -1 - 1 }} | ||
6 | {{ not (false or true) }} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
10 | /1 | ||
11 | 2/-2 | ||
12 | |||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test deleted file mode 100644 index cc6eef8d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig unary operators precedence | ||
3 | --TEMPLATE-- | ||
4 | {{ -1 - 1 }} | ||
5 | {{ -1 - -1 }} | ||
6 | {{ -1 * -1 }} | ||
7 | {{ 4 / -1 * 5 }} | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXPECT-- | ||
11 | -2 | ||
12 | 0 | ||
13 | 1 | ||
14 | -20 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test deleted file mode 100644 index 27e93fd6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
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 deleted file mode 100644 index cb6de7f9..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
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 deleted file mode 100644 index 52de39cb..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.php +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
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 deleted file mode 100644 index af996f24..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
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 deleted file mode 100644 index 746295f1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
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 deleted file mode 100644 index 380b04bb..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
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 deleted file mode 100644 index d40bb04a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
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 deleted file mode 100644 index 11a1ef4b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
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 deleted file mode 100644 index e6d3707d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
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 deleted file mode 100644 index 0c8c6f1a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
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 deleted file mode 100644 index 53d3a69c..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
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 deleted file mode 100644 index 4ecde8a1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
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 deleted file mode 100644 index 0e4404b1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test +++ /dev/null | |||
@@ -1,150 +0,0 @@ | |||
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 deleted file mode 100644 index 93c5913f..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
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 deleted file mode 100644 index a606c106..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
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 deleted file mode 100644 index bba26a0d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
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 deleted file mode 100644 index 853465b6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
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 deleted file mode 100644 index 85a9b717..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
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 deleted file mode 100644 index 97221ff8..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
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 deleted file mode 100644 index b342c174..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
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 deleted file mode 100644 index 1738d40c..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
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 deleted file mode 100644 index ca3ac0cf..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
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 deleted file mode 100644 index 3347474d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
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 deleted file mode 100644 index 5d5e2436..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
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 deleted file mode 100644 index 2bd3d4c0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
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 deleted file mode 100644 index 6545a9bb..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
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 deleted file mode 100644 index 639a8659..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
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 deleted file mode 100644 index c6903cc7..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
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 deleted file mode 100644 index 4021660b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
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 deleted file mode 100644 index 7948ac45..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
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 deleted file mode 100644 index b37ad651..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
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 deleted file mode 100644 index 21d575f1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
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 deleted file mode 100644 index dbaf7dc9..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
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 deleted file mode 100644 index ce8ec9ce..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
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 deleted file mode 100644 index 31920625..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
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 deleted file mode 100644 index de956e7a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
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 | ||
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 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test deleted file mode 100644 index 4ccff7b6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | macro | ||
3 | --TEMPLATE-- | ||
4 | {% from _self import test %} | ||
5 | |||
6 | {% macro test(a, b = 'bar') -%} | ||
7 | {{ a }}{{ b }} | ||
8 | {%- endmacro %} | ||
9 | |||
10 | {{ test('foo') }} | ||
11 | {{ test('bar', 'foo') }} | ||
12 | --DATA-- | ||
13 | return array(); | ||
14 | --EXPECT-- | ||
15 | foobar | ||
16 | barfoo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test deleted file mode 100644 index cd254281..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | --TEST-- | ||
2 | macro | ||
3 | --TEMPLATE-- | ||
4 | {% import _self as macros %} | ||
5 | |||
6 | {% macro foo(data) %} | ||
7 | {{ data }} | ||
8 | {% endmacro %} | ||
9 | |||
10 | {% macro bar() %} | ||
11 | <br /> | ||
12 | {% endmacro %} | ||
13 | |||
14 | {{ macros.foo(macros.bar()) }} | ||
15 | --DATA-- | ||
16 | return array(); | ||
17 | --EXPECT-- | ||
18 | <br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test deleted file mode 100644 index cbfb921b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | macro | ||
3 | --TEMPLATE-- | ||
4 | {% from _self import test %} | ||
5 | |||
6 | {% macro test(this) -%} | ||
7 | {{ this }} | ||
8 | {%- endmacro %} | ||
9 | |||
10 | {{ test(this) }} | ||
11 | --DATA-- | ||
12 | return array('this' => 'foo'); | ||
13 | --EXPECT-- | ||
14 | foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test deleted file mode 100644 index 6a366cdf..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | --TEST-- | ||
2 | macro | ||
3 | --TEMPLATE-- | ||
4 | {% import _self as test %} | ||
5 | {% from _self import test %} | ||
6 | |||
7 | {% macro test(a, b) -%} | ||
8 | {{ a|default('a') }}<br /> | ||
9 | {{- b|default('b') }}<br /> | ||
10 | {%- endmacro %} | ||
11 | |||
12 | {{ test.test() }} | ||
13 | {{ test() }} | ||
14 | {{ test.test(1, "c") }} | ||
15 | {{ test(1, "c") }} | ||
16 | --DATA-- | ||
17 | return array(); | ||
18 | --EXPECT-- | ||
19 | a<br />b<br /> | ||
20 | a<br />b<br /> | ||
21 | 1<br />c<br /> | ||
22 | 1<br />c<br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test deleted file mode 100644 index 685626f2..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | macro with a filter | ||
3 | --TEMPLATE-- | ||
4 | {% import _self as test %} | ||
5 | |||
6 | {% macro test() %} | ||
7 | {% filter escape %}foo<br />{% endfilter %} | ||
8 | {% endmacro %} | ||
9 | |||
10 | {{ test.test() }} | ||
11 | --DATA-- | ||
12 | return array(); | ||
13 | --EXPECT-- | ||
14 | foo<br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test deleted file mode 100644 index 65f6cd2b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig outputs 0 nodes correctly | ||
3 | --TEMPLATE-- | ||
4 | {{ foo }}0{{ foo }} | ||
5 | --DATA-- | ||
6 | return array('foo' => 'foo') | ||
7 | --EXPECT-- | ||
8 | foo0foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test deleted file mode 100644 index 110aef82..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig is able to deal with SimpleXMLElement instances as variables | ||
3 | --CONDITION-- | ||
4 | version_compare(phpversion(), '5.3.0', '>=') | ||
5 | --TEMPLATE-- | ||
6 | Hello '{{ images.image.0.group }}'! | ||
7 | {{ images.children().count() }} | ||
8 | {% for image in images %} | ||
9 | - {{ image.group }} | ||
10 | {% endfor %} | ||
11 | --DATA-- | ||
12 | return array('images' => new SimpleXMLElement('<images><image><group>foo</group></image><image><group>bar</group></image></images>')) | ||
13 | --EXPECT-- | ||
14 | Hello 'foo'! | ||
15 | 2 | ||
16 | - foo | ||
17 | - bar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test deleted file mode 100644 index e18e1107..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig does not confuse strings with integers in getAttribute() | ||
3 | --TEMPLATE-- | ||
4 | {{ hash['2e2'] }} | ||
5 | --DATA-- | ||
6 | return array('hash' => array('2e2' => 'works')) | ||
7 | --EXPECT-- | ||
8 | works | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test deleted file mode 100644 index 2f6a3e1a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag applies escaping on its children | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape %} | ||
5 | {{ var }}<br /> | ||
6 | {% endautoescape %} | ||
7 | {% autoescape 'html' %} | ||
8 | {{ var }}<br /> | ||
9 | {% endautoescape %} | ||
10 | {% autoescape false %} | ||
11 | {{ var }}<br /> | ||
12 | {% endautoescape %} | ||
13 | {% autoescape true %} | ||
14 | {{ var }}<br /> | ||
15 | {% endautoescape %} | ||
16 | {% autoescape false %} | ||
17 | {{ var }}<br /> | ||
18 | {% endautoescape %} | ||
19 | --DATA-- | ||
20 | return array('var' => '<br />') | ||
21 | --EXPECT-- | ||
22 | <br /><br /> | ||
23 | <br /><br /> | ||
24 | <br /><br /> | ||
25 | <br /><br /> | ||
26 | <br /><br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test deleted file mode 100644 index 05ab83ce..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag applies escaping on embedded blocks | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape 'html' %} | ||
5 | {% block foo %} | ||
6 | {{ var }} | ||
7 | {% endblock %} | ||
8 | {% endautoescape %} | ||
9 | --DATA-- | ||
10 | return array('var' => '<br />') | ||
11 | --EXPECT-- | ||
12 | <br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test deleted file mode 100644 index 9c097246..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag does not double-escape | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape 'html' %} | ||
5 | {{ var|escape }} | ||
6 | {% endautoescape %} | ||
7 | --DATA-- | ||
8 | return array('var' => '<br />') | ||
9 | --EXPECT-- | ||
10 | <br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test deleted file mode 100644 index ce7ea789..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag applies escaping after calling functions | ||
3 | --TEMPLATE-- | ||
4 | |||
5 | autoescape false | ||
6 | {% autoescape false %} | ||
7 | |||
8 | safe_br | ||
9 | {{ safe_br() }} | ||
10 | |||
11 | unsafe_br | ||
12 | {{ unsafe_br() }} | ||
13 | |||
14 | {% endautoescape %} | ||
15 | |||
16 | autoescape 'html' | ||
17 | {% autoescape 'html' %} | ||
18 | |||
19 | safe_br | ||
20 | {{ safe_br() }} | ||
21 | |||
22 | unsafe_br | ||
23 | {{ unsafe_br() }} | ||
24 | |||
25 | unsafe_br()|raw | ||
26 | {{ (unsafe_br())|raw }} | ||
27 | |||
28 | safe_br()|escape | ||
29 | {{ (safe_br())|escape }} | ||
30 | |||
31 | safe_br()|raw | ||
32 | {{ (safe_br())|raw }} | ||
33 | |||
34 | unsafe_br()|escape | ||
35 | {{ (unsafe_br())|escape }} | ||
36 | |||
37 | {% endautoescape %} | ||
38 | |||
39 | autoescape js | ||
40 | {% autoescape 'js' %} | ||
41 | |||
42 | safe_br | ||
43 | {{ safe_br() }} | ||
44 | |||
45 | {% endautoescape %} | ||
46 | --DATA-- | ||
47 | return array() | ||
48 | --EXPECT-- | ||
49 | |||
50 | autoescape false | ||
51 | |||
52 | safe_br | ||
53 | <br /> | ||
54 | |||
55 | unsafe_br | ||
56 | <br /> | ||
57 | |||
58 | |||
59 | autoescape 'html' | ||
60 | |||
61 | safe_br | ||
62 | <br /> | ||
63 | |||
64 | unsafe_br | ||
65 | <br /> | ||
66 | |||
67 | unsafe_br()|raw | ||
68 | <br /> | ||
69 | |||
70 | safe_br()|escape | ||
71 | <br /> | ||
72 | |||
73 | safe_br()|raw | ||
74 | <br /> | ||
75 | |||
76 | unsafe_br()|escape | ||
77 | <br /> | ||
78 | |||
79 | |||
80 | autoescape js | ||
81 | |||
82 | safe_br | ||
83 | \x3Cbr\x20\x2F\x3E | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test deleted file mode 100644 index e389d4dd..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag does not apply escaping on literals | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape 'html' %} | ||
5 | |||
6 | 1. Simple literal | ||
7 | {{ "<br />" }} | ||
8 | |||
9 | 2. Conditional expression with only literals | ||
10 | {{ true ? "<br />" : "<br>" }} | ||
11 | |||
12 | 3. Conditional expression with a variable | ||
13 | {{ true ? "<br />" : someVar }} | ||
14 | |||
15 | 4. Nested conditionals with only literals | ||
16 | {{ true ? (true ? "<br />" : "<br>") : "\n" }} | ||
17 | |||
18 | 5. Nested conditionals with a variable | ||
19 | {{ true ? (true ? "<br />" : someVar) : "\n" }} | ||
20 | |||
21 | 6. Nested conditionals with a variable marked safe | ||
22 | {{ true ? (true ? "<br />" : someVar|raw) : "\n" }} | ||
23 | |||
24 | {% endautoescape %} | ||
25 | --DATA-- | ||
26 | return array() | ||
27 | --EXPECT-- | ||
28 | |||
29 | 1. Simple literal | ||
30 | <br /> | ||
31 | |||
32 | 2. Conditional expression with only literals | ||
33 | <br /> | ||
34 | |||
35 | 3. Conditional expression with a variable | ||
36 | <br /> | ||
37 | |||
38 | 4. Nested conditionals with only literals | ||
39 | <br /> | ||
40 | |||
41 | 5. Nested conditionals with a variable | ||
42 | <br /> | ||
43 | |||
44 | 6. Nested conditionals with a variable marked safe | ||
45 | <br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test deleted file mode 100644 index 798e6fea..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tags can be nested at will | ||
3 | --TEMPLATE-- | ||
4 | {{ var }} | ||
5 | {% autoescape 'html' %} | ||
6 | {{ var }} | ||
7 | {% autoescape false %} | ||
8 | {{ var }} | ||
9 | {% autoescape 'html' %} | ||
10 | {{ var }} | ||
11 | {% endautoescape %} | ||
12 | {{ var }} | ||
13 | {% endautoescape %} | ||
14 | {{ var }} | ||
15 | {% endautoescape %} | ||
16 | {{ var }} | ||
17 | --DATA-- | ||
18 | return array('var' => '<br />') | ||
19 | --EXPECT-- | ||
20 | <br /> | ||
21 | <br /> | ||
22 | <br /> | ||
23 | <br /> | ||
24 | <br /> | ||
25 | <br /> | ||
26 | <br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test deleted file mode 100644 index e896aa41..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag applies escaping to object method calls | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape 'html' %} | ||
5 | {{ user.name }} | ||
6 | {{ user.name|lower }} | ||
7 | {{ user }} | ||
8 | {% endautoescape %} | ||
9 | --DATA-- | ||
10 | class UserForAutoEscapeTest | ||
11 | { | ||
12 | public function getName() | ||
13 | { | ||
14 | return 'Fabien<br />'; | ||
15 | } | ||
16 | |||
17 | public function __toString() | ||
18 | { | ||
19 | return 'Fabien<br />'; | ||
20 | } | ||
21 | } | ||
22 | return array('user' => new UserForAutoEscapeTest()) | ||
23 | --EXPECT-- | ||
24 | Fabien<br /> | ||
25 | fabien<br /> | ||
26 | Fabien<br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test deleted file mode 100644 index 9f1cedd3..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag does not escape when raw is used as a filter | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape 'html' %} | ||
5 | {{ var|raw }} | ||
6 | {% endautoescape %} | ||
7 | --DATA-- | ||
8 | return array('var' => '<br />') | ||
9 | --EXPECT-- | ||
10 | <br /> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test deleted file mode 100644 index cf8cceef..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag accepts an escaping strategy | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape true js %}{{ var }}{% endautoescape %} | ||
5 | |||
6 | {% autoescape true html %}{{ var }}{% endautoescape %} | ||
7 | |||
8 | {% autoescape 'js' %}{{ var }}{% endautoescape %} | ||
9 | |||
10 | {% autoescape 'html' %}{{ var }}{% endautoescape %} | ||
11 | --DATA-- | ||
12 | return array('var' => '<br />"') | ||
13 | --EXPECT-- | ||
14 | \x3Cbr\x20\x2F\x3E\x22 | ||
15 | <br />" | ||
16 | \x3Cbr\x20\x2F\x3E\x22 | ||
17 | <br />" | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test deleted file mode 100644 index 4f415201..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | --TEST-- | ||
2 | escape types | ||
3 | --TEMPLATE-- | ||
4 | |||
5 | 1. autoescape 'html' |escape('js') | ||
6 | |||
7 | {% autoescape 'html' %} | ||
8 | <a onclick="alert("{{ msg|escape('js') }}")"></a> | ||
9 | {% endautoescape %} | ||
10 | |||
11 | 2. autoescape 'html' |escape('js') | ||
12 | |||
13 | {% autoescape 'html' %} | ||
14 | <a onclick="alert("{{ msg|escape('js') }}")"></a> | ||
15 | {% endautoescape %} | ||
16 | |||
17 | 3. autoescape 'js' |escape('js') | ||
18 | |||
19 | {% autoescape 'js' %} | ||
20 | <a onclick="alert("{{ msg|escape('js') }}")"></a> | ||
21 | {% endautoescape %} | ||
22 | |||
23 | 4. no escape | ||
24 | |||
25 | {% autoescape false %} | ||
26 | <a onclick="alert("{{ msg }}")"></a> | ||
27 | {% endautoescape %} | ||
28 | |||
29 | 5. |escape('js')|escape('html') | ||
30 | |||
31 | {% autoescape false %} | ||
32 | <a onclick="alert("{{ msg|escape('js')|escape('html') }}")"></a> | ||
33 | {% endautoescape %} | ||
34 | |||
35 | 6. autoescape 'html' |escape('js')|escape('html') | ||
36 | |||
37 | {% autoescape 'html' %} | ||
38 | <a onclick="alert("{{ msg|escape('js')|escape('html') }}")"></a> | ||
39 | {% endautoescape %} | ||
40 | |||
41 | --DATA-- | ||
42 | return array('msg' => "<>\n'\"") | ||
43 | --EXPECT-- | ||
44 | |||
45 | 1. autoescape 'html' |escape('js') | ||
46 | |||
47 | <a onclick="alert("\x3C\x3E\x0A\x27\x22")"></a> | ||
48 | |||
49 | 2. autoescape 'html' |escape('js') | ||
50 | |||
51 | <a onclick="alert("\x3C\x3E\x0A\x27\x22")"></a> | ||
52 | |||
53 | 3. autoescape 'js' |escape('js') | ||
54 | |||
55 | <a onclick="alert("\x3C\x3E\x0A\x27\x22")"></a> | ||
56 | |||
57 | 4. no escape | ||
58 | |||
59 | <a onclick="alert("<> | ||
60 | '"")"></a> | ||
61 | |||
62 | 5. |escape('js')|escape('html') | ||
63 | |||
64 | <a onclick="alert("\x3C\x3E\x0A\x27\x22")"></a> | ||
65 | |||
66 | 6. autoescape 'html' |escape('js')|escape('html') | ||
67 | |||
68 | <a onclick="alert("\x3C\x3E\x0A\x27\x22")"></a> | ||
69 | |||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test deleted file mode 100644 index 7821a9aa..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test +++ /dev/null | |||
@@ -1,131 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag applies escaping after calling filters | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape 'html' %} | ||
5 | |||
6 | (escape_and_nl2br is an escaper filter) | ||
7 | |||
8 | 1. Don't escape escaper filter output | ||
9 | ( var is escaped by |escape_and_nl2br, line-breaks are added, | ||
10 | the output is not escaped ) | ||
11 | {{ var|escape_and_nl2br }} | ||
12 | |||
13 | 2. Don't escape escaper filter output | ||
14 | ( var is escaped by |escape_and_nl2br, line-breaks are added, | ||
15 | the output is not escaped, |raw is redundant ) | ||
16 | {{ var|escape_and_nl2br|raw }} | ||
17 | |||
18 | 3. Explicit escape | ||
19 | ( var is escaped by |escape_and_nl2br, line-breaks are added, | ||
20 | the output is explicitly escaped by |escape ) | ||
21 | {{ var|escape_and_nl2br|escape }} | ||
22 | |||
23 | 4. Escape non-escaper filter output | ||
24 | ( var is upper-cased by |upper, | ||
25 | the output is auto-escaped ) | ||
26 | {{ var|upper }} | ||
27 | |||
28 | 5. Escape if last filter is not an escaper | ||
29 | ( var is escaped by |escape_and_nl2br, line-breaks are added, | ||
30 | the output is upper-cased by |upper, | ||
31 | the output is auto-escaped as |upper is not an escaper ) | ||
32 | {{ var|escape_and_nl2br|upper }} | ||
33 | |||
34 | 6. Don't escape escaper filter output | ||
35 | ( var is upper cased by upper, | ||
36 | the output is escaped by |escape_and_nl2br, line-breaks are added, | ||
37 | the output is not escaped as |escape_and_nl2br is an escaper ) | ||
38 | {{ var|upper|escape_and_nl2br }} | ||
39 | |||
40 | 7. Escape if last filter is not an escaper | ||
41 | ( the output of |format is "<b>" ~ var ~ "</b>", | ||
42 | the output is auto-escaped ) | ||
43 | {{ "<b>%s</b>"|format(var) }} | ||
44 | |||
45 | 8. Escape if last filter is not an escaper | ||
46 | ( the output of |format is "<b>" ~ var ~ "</b>", | ||
47 | |raw is redundant, | ||
48 | the output is auto-escaped ) | ||
49 | {{ "<b>%s</b>"|raw|format(var) }} | ||
50 | |||
51 | 9. Don't escape escaper filter output | ||
52 | ( the output of |format is "<b>" ~ var ~ "</b>", | ||
53 | the output is not escaped due to |raw filter at the end ) | ||
54 | {{ "<b>%s</b>"|format(var)|raw }} | ||
55 | |||
56 | 10. Don't escape escaper filter output | ||
57 | ( the output of |format is "<b>" ~ var ~ "</b>", | ||
58 | the output is not escaped due to |raw filter at the end, | ||
59 | the |raw filter on var is redundant ) | ||
60 | {{ "<b>%s</b>"|format(var|raw)|raw }} | ||
61 | |||
62 | {% endautoescape %} | ||
63 | --DATA-- | ||
64 | return array('var' => "<Fabien>\nTwig") | ||
65 | --EXPECT-- | ||
66 | |||
67 | (escape_and_nl2br is an escaper filter) | ||
68 | |||
69 | 1. Don't escape escaper filter output | ||
70 | ( var is escaped by |escape_and_nl2br, line-breaks are added, | ||
71 | the output is not escaped ) | ||
72 | <Fabien><br /> | ||
73 | Twig | ||
74 | |||
75 | 2. Don't escape escaper filter output | ||
76 | ( var is escaped by |escape_and_nl2br, line-breaks are added, | ||
77 | the output is not escaped, |raw is redundant ) | ||
78 | <Fabien><br /> | ||
79 | Twig | ||
80 | |||
81 | 3. Explicit escape | ||
82 | ( var is escaped by |escape_and_nl2br, line-breaks are added, | ||
83 | the output is explicitly escaped by |escape ) | ||
84 | &lt;Fabien&gt;<br /> | ||
85 | Twig | ||
86 | |||
87 | 4. Escape non-escaper filter output | ||
88 | ( var is upper-cased by |upper, | ||
89 | the output is auto-escaped ) | ||
90 | <FABIEN> | ||
91 | TWIG | ||
92 | |||
93 | 5. Escape if last filter is not an escaper | ||
94 | ( var is escaped by |escape_and_nl2br, line-breaks are added, | ||
95 | the output is upper-cased by |upper, | ||
96 | the output is auto-escaped as |upper is not an escaper ) | ||
97 | &LT;FABIEN&GT;<BR /> | ||
98 | TWIG | ||
99 | |||
100 | 6. Don't escape escaper filter output | ||
101 | ( var is upper cased by upper, | ||
102 | the output is escaped by |escape_and_nl2br, line-breaks are added, | ||
103 | the output is not escaped as |escape_and_nl2br is an escaper ) | ||
104 | <FABIEN><br /> | ||
105 | TWIG | ||
106 | |||
107 | 7. Escape if last filter is not an escaper | ||
108 | ( the output of |format is "<b>" ~ var ~ "</b>", | ||
109 | the output is auto-escaped ) | ||
110 | <b><Fabien> | ||
111 | Twig</b> | ||
112 | |||
113 | 8. Escape if last filter is not an escaper | ||
114 | ( the output of |format is "<b>" ~ var ~ "</b>", | ||
115 | |raw is redundant, | ||
116 | the output is auto-escaped ) | ||
117 | <b><Fabien> | ||
118 | Twig</b> | ||
119 | |||
120 | 9. Don't escape escaper filter output | ||
121 | ( the output of |format is "<b>" ~ var ~ "</b>", | ||
122 | the output is not escaped due to |raw filter at the end ) | ||
123 | <b><Fabien> | ||
124 | Twig</b> | ||
125 | |||
126 | 10. Don't escape escaper filter output | ||
127 | ( the output of |format is "<b>" ~ var ~ "</b>", | ||
128 | the output is not escaped due to |raw filter at the end, | ||
129 | the |raw filter on var is redundant ) | ||
130 | <b><Fabien> | ||
131 | Twig</b> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test deleted file mode 100644 index f58a1e09..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag do not applies escaping on filter arguments | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape 'html' %} | ||
5 | {{ var|nl2br("<br />") }} | ||
6 | {{ var|nl2br("<br />"|escape) }} | ||
7 | {{ var|nl2br(sep) }} | ||
8 | {{ var|nl2br(sep|raw) }} | ||
9 | {{ var|nl2br(sep|escape) }} | ||
10 | {% endautoescape %} | ||
11 | --DATA-- | ||
12 | return array('var' => "<Fabien>\nTwig", 'sep' => '<br />') | ||
13 | --EXPECT-- | ||
14 | <Fabien><br /> | ||
15 | Twig | ||
16 | <Fabien><br /> | ||
17 | Twig | ||
18 | <Fabien><br /> | ||
19 | Twig | ||
20 | <Fabien><br /> | ||
21 | Twig | ||
22 | <Fabien><br /> | ||
23 | Twig | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test deleted file mode 100644 index 134c77ea..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag applies escaping after calling filters, and before calling pre_escape filters | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape 'html' %} | ||
5 | |||
6 | (nl2br is pre_escaped for "html" and declared safe for "html") | ||
7 | |||
8 | 1. Pre-escape and don't post-escape | ||
9 | ( var|escape|nl2br ) | ||
10 | {{ var|nl2br }} | ||
11 | |||
12 | 2. Don't double-pre-escape | ||
13 | ( var|escape|nl2br ) | ||
14 | {{ var|escape|nl2br }} | ||
15 | |||
16 | 3. Don't escape safe values | ||
17 | ( var|raw|nl2br ) | ||
18 | {{ var|raw|nl2br }} | ||
19 | |||
20 | 4. Don't escape safe values | ||
21 | ( var|escape|nl2br|nl2br ) | ||
22 | {{ var|nl2br|nl2br }} | ||
23 | |||
24 | 5. Re-escape values that are escaped for an other contexts | ||
25 | ( var|escape_something|escape|nl2br ) | ||
26 | {{ var|escape_something|nl2br }} | ||
27 | |||
28 | 6. Still escape when using filters not declared safe | ||
29 | ( var|escape|nl2br|upper|escape ) | ||
30 | {{ var|nl2br|upper }} | ||
31 | |||
32 | {% endautoescape %} | ||
33 | --DATA-- | ||
34 | return array('var' => "<Fabien>\nTwig") | ||
35 | --EXPECT-- | ||
36 | |||
37 | (nl2br is pre_escaped for "html" and declared safe for "html") | ||
38 | |||
39 | 1. Pre-escape and don't post-escape | ||
40 | ( var|escape|nl2br ) | ||
41 | <Fabien><br /> | ||
42 | Twig | ||
43 | |||
44 | 2. Don't double-pre-escape | ||
45 | ( var|escape|nl2br ) | ||
46 | <Fabien><br /> | ||
47 | Twig | ||
48 | |||
49 | 3. Don't escape safe values | ||
50 | ( var|raw|nl2br ) | ||
51 | <Fabien><br /> | ||
52 | Twig | ||
53 | |||
54 | 4. Don't escape safe values | ||
55 | ( var|escape|nl2br|nl2br ) | ||
56 | <Fabien><br /><br /> | ||
57 | Twig | ||
58 | |||
59 | 5. Re-escape values that are escaped for an other contexts | ||
60 | ( var|escape_something|escape|nl2br ) | ||
61 | <FABIEN><br /> | ||
62 | TWIG | ||
63 | |||
64 | 6. Still escape when using filters not declared safe | ||
65 | ( var|escape|nl2br|upper|escape ) | ||
66 | &LT;FABIEN&GT;<BR /> | ||
67 | TWIG | ||
68 | |||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test deleted file mode 100644 index 32d3943b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "autoescape" tag handles filters preserving the safety | ||
3 | --TEMPLATE-- | ||
4 | {% autoescape 'html' %} | ||
5 | |||
6 | (preserves_safety is preserving safety for "html") | ||
7 | |||
8 | 1. Unsafe values are still unsafe | ||
9 | ( var|preserves_safety|escape ) | ||
10 | {{ var|preserves_safety }} | ||
11 | |||
12 | 2. Safe values are still safe | ||
13 | ( var|escape|preserves_safety ) | ||
14 | {{ var|escape|preserves_safety }} | ||
15 | |||
16 | 3. Re-escape values that are escaped for an other contexts | ||
17 | ( var|escape_something|preserves_safety|escape ) | ||
18 | {{ var|escape_something|preserves_safety }} | ||
19 | |||
20 | 4. Still escape when using filters not declared safe | ||
21 | ( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) | ||
22 | {{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }} | ||
23 | |||
24 | {% endautoescape %} | ||
25 | --DATA-- | ||
26 | return array('var' => "<Fabien>\nTwig") | ||
27 | --EXPECT-- | ||
28 | |||
29 | (preserves_safety is preserving safety for "html") | ||
30 | |||
31 | 1. Unsafe values are still unsafe | ||
32 | ( var|preserves_safety|escape ) | ||
33 | <FABIEN> | ||
34 | TWIG | ||
35 | |||
36 | 2. Safe values are still safe | ||
37 | ( var|escape|preserves_safety ) | ||
38 | <FABIEN> | ||
39 | TWIG | ||
40 | |||
41 | 3. Re-escape values that are escaped for an other contexts | ||
42 | ( var|escape_something|preserves_safety|escape ) | ||
43 | <FABIEN> | ||
44 | TWIG | ||
45 | |||
46 | 4. Still escape when using filters not declared safe | ||
47 | ( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) | ||
48 | &LT;FABPOT&GT; | ||
49 | TWIG | ||
50 | |||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test deleted file mode 100644 index 360dcf03..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "block" tag | ||
3 | --TEMPLATE-- | ||
4 | {% block title1 %}FOO{% endblock %} | ||
5 | {% block title2 foo|lower %} | ||
6 | --TEMPLATE(foo.twig)-- | ||
7 | {% block content %}{% endblock %} | ||
8 | --DATA-- | ||
9 | return array('foo' => 'bar') | ||
10 | --EXPECT-- | ||
11 | FOObar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test deleted file mode 100644 index 5c205c0a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "block" tag | ||
3 | --TEMPLATE-- | ||
4 | {% block content %} | ||
5 | {% block content %} | ||
6 | {% endblock %} | ||
7 | {% endblock %} | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXCEPTION-- | ||
11 | Twig_Error_Syntax: The block 'content' has already been defined line 2 in "index.twig" at line 3 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test deleted file mode 100644 index be17fedf..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "§" special chars in a block name | ||
3 | --TEMPLATE-- | ||
4 | {% block § %} | ||
5 | § | ||
6 | {% endblock § %} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
10 | § | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test deleted file mode 100644 index f44296ea..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "embed" tag | ||
3 | --TEMPLATE-- | ||
4 | FOO | ||
5 | {% embed "foo.twig" %} | ||
6 | {% block c1 %} | ||
7 | {{ parent() }} | ||
8 | block1extended | ||
9 | {% endblock %} | ||
10 | {% endembed %} | ||
11 | |||
12 | BAR | ||
13 | --TEMPLATE(foo.twig)-- | ||
14 | A | ||
15 | {% block c1 %} | ||
16 | block1 | ||
17 | {% endblock %} | ||
18 | B | ||
19 | {% block c2 %} | ||
20 | block2 | ||
21 | {% endblock %} | ||
22 | C | ||
23 | --DATA-- | ||
24 | return array() | ||
25 | --EXPECT-- | ||
26 | FOO | ||
27 | |||
28 | A | ||
29 | block1 | ||
30 | |||
31 | block1extended | ||
32 | B | ||
33 | block2 | ||
34 | C | ||
35 | BAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test deleted file mode 100644 index 71ab2e01..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "embed" tag | ||
3 | --TEMPLATE(index.twig)-- | ||
4 | FOO | ||
5 | {% embed "foo.twig" %} | ||
6 | {% block c1 %} | ||
7 | {{ nothing }} | ||
8 | {% endblock %} | ||
9 | {% endembed %} | ||
10 | BAR | ||
11 | --TEMPLATE(foo.twig)-- | ||
12 | {% block c1 %}{% endblock %} | ||
13 | --DATA-- | ||
14 | return array() | ||
15 | --EXCEPTION-- | ||
16 | Twig_Error_Runtime: Variable "nothing" does not exist in "index.twig" at line 5 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test deleted file mode 100644 index da161e6d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "embed" tag | ||
3 | --TEMPLATE-- | ||
4 | FOO | ||
5 | {% embed "foo.twig" %} | ||
6 | {% block c1 %} | ||
7 | {{ parent() }} | ||
8 | block1extended | ||
9 | {% endblock %} | ||
10 | {% endembed %} | ||
11 | |||
12 | {% embed "foo.twig" %} | ||
13 | {% block c1 %} | ||
14 | {{ parent() }} | ||
15 | block1extended | ||
16 | {% endblock %} | ||
17 | {% endembed %} | ||
18 | |||
19 | BAR | ||
20 | --TEMPLATE(foo.twig)-- | ||
21 | A | ||
22 | {% block c1 %} | ||
23 | block1 | ||
24 | {% endblock %} | ||
25 | B | ||
26 | {% block c2 %} | ||
27 | block2 | ||
28 | {% endblock %} | ||
29 | C | ||
30 | --DATA-- | ||
31 | return array() | ||
32 | --EXPECT-- | ||
33 | FOO | ||
34 | |||
35 | A | ||
36 | block1 | ||
37 | |||
38 | block1extended | ||
39 | B | ||
40 | block2 | ||
41 | C | ||
42 | |||
43 | A | ||
44 | block1 | ||
45 | |||
46 | block1extended | ||
47 | B | ||
48 | block2 | ||
49 | C | ||
50 | BAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test deleted file mode 100644 index 81563dce..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "embed" tag | ||
3 | --TEMPLATE-- | ||
4 | {% embed "foo.twig" %} | ||
5 | {% block c1 %} | ||
6 | {{ parent() }} | ||
7 | {% embed "foo.twig" %} | ||
8 | {% block c1 %} | ||
9 | {{ parent() }} | ||
10 | block1extended | ||
11 | {% endblock %} | ||
12 | {% endembed %} | ||
13 | |||
14 | {% endblock %} | ||
15 | {% endembed %} | ||
16 | --TEMPLATE(foo.twig)-- | ||
17 | A | ||
18 | {% block c1 %} | ||
19 | block1 | ||
20 | {% endblock %} | ||
21 | B | ||
22 | {% block c2 %} | ||
23 | block2 | ||
24 | {% endblock %} | ||
25 | C | ||
26 | --DATA-- | ||
27 | return array() | ||
28 | --EXPECT-- | ||
29 | A | ||
30 | block1 | ||
31 | |||
32 | |||
33 | A | ||
34 | block1 | ||
35 | |||
36 | block1extended | ||
37 | B | ||
38 | block2 | ||
39 | C | ||
40 | B | ||
41 | block2 | ||
42 | C | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test deleted file mode 100644 index cf7953d3..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "embed" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends "base.twig" %} | ||
5 | |||
6 | {% block c1 %} | ||
7 | {{ parent() }} | ||
8 | blockc1baseextended | ||
9 | {% endblock %} | ||
10 | |||
11 | {% block c2 %} | ||
12 | {{ parent() }} | ||
13 | |||
14 | {% embed "foo.twig" %} | ||
15 | {% block c1 %} | ||
16 | {{ parent() }} | ||
17 | block1extended | ||
18 | {% endblock %} | ||
19 | {% endembed %} | ||
20 | {% endblock %} | ||
21 | --TEMPLATE(base.twig)-- | ||
22 | A | ||
23 | {% block c1 %} | ||
24 | blockc1base | ||
25 | {% endblock %} | ||
26 | {% block c2 %} | ||
27 | blockc2base | ||
28 | {% endblock %} | ||
29 | B | ||
30 | --TEMPLATE(foo.twig)-- | ||
31 | A | ||
32 | {% block c1 %} | ||
33 | block1 | ||
34 | {% endblock %} | ||
35 | B | ||
36 | {% block c2 %} | ||
37 | block2 | ||
38 | {% endblock %} | ||
39 | C | ||
40 | --DATA-- | ||
41 | return array() | ||
42 | --EXPECT-- | ||
43 | A | ||
44 | blockc1base | ||
45 | |||
46 | blockc1baseextended | ||
47 | blockc2base | ||
48 | |||
49 | |||
50 | |||
51 | A | ||
52 | block1 | ||
53 | |||
54 | block1extended | ||
55 | B | ||
56 | block2 | ||
57 | CB \ No newline at end of file | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test deleted file mode 100644 index 82094f2f..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "filter" tag applies a filter on its children | ||
3 | --TEMPLATE-- | ||
4 | {% filter upper %} | ||
5 | Some text with a {{ var }} | ||
6 | {% endfilter %} | ||
7 | --DATA-- | ||
8 | return array('var' => 'var') | ||
9 | --EXPECT-- | ||
10 | SOME TEXT WITH A VAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test deleted file mode 100644 index 3e7148bf..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "filter" tag applies a filter on its children | ||
3 | --TEMPLATE-- | ||
4 | {% filter json_encode|raw %}test{% endfilter %} | ||
5 | --DATA-- | ||
6 | return array() | ||
7 | --EXPECT-- | ||
8 | "test" | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test deleted file mode 100644 index 75512ef9..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "filter" tags accept multiple chained filters | ||
3 | --TEMPLATE-- | ||
4 | {% filter lower|title %} | ||
5 | {{ var }} | ||
6 | {% endfilter %} | ||
7 | --DATA-- | ||
8 | return array('var' => 'VAR') | ||
9 | --EXPECT-- | ||
10 | Var | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test deleted file mode 100644 index 7e4e4eb3..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "filter" tags can be nested at will | ||
3 | --TEMPLATE-- | ||
4 | {% filter lower|title %} | ||
5 | {{ var }} | ||
6 | {% filter upper %} | ||
7 | {{ var }} | ||
8 | {% endfilter %} | ||
9 | {{ var }} | ||
10 | {% endfilter %} | ||
11 | --DATA-- | ||
12 | return array('var' => 'var') | ||
13 | --EXPECT-- | ||
14 | Var | ||
15 | Var | ||
16 | Var | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test deleted file mode 100644 index 22745ead..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "filter" tag applies the filter on "for" tags | ||
3 | --TEMPLATE-- | ||
4 | {% filter upper %} | ||
5 | {% for item in items %} | ||
6 | {{ item }} | ||
7 | {% endfor %} | ||
8 | {% endfilter %} | ||
9 | --DATA-- | ||
10 | return array('items' => array('a', 'b')) | ||
11 | --EXPECT-- | ||
12 | A | ||
13 | B | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test deleted file mode 100644 index afd95b29..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "filter" tag applies the filter on "if" tags | ||
3 | --TEMPLATE-- | ||
4 | {% filter upper %} | ||
5 | {% if items %} | ||
6 | {{ items|join(', ') }} | ||
7 | {% endif %} | ||
8 | |||
9 | {% if items.3 is defined %} | ||
10 | FOO | ||
11 | {% else %} | ||
12 | {{ items.1 }} | ||
13 | {% endif %} | ||
14 | |||
15 | {% if items.3 is defined %} | ||
16 | FOO | ||
17 | {% elseif items.1 %} | ||
18 | {{ items.0 }} | ||
19 | {% endif %} | ||
20 | |||
21 | {% endfilter %} | ||
22 | --DATA-- | ||
23 | return array('items' => array('a', 'b')) | ||
24 | --EXPECT-- | ||
25 | A, B | ||
26 | |||
27 | B | ||
28 | |||
29 | A | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test deleted file mode 100644 index 380531f7..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag takes a condition | ||
3 | --TEMPLATE-- | ||
4 | {% for i in 1..5 if i is odd -%} | ||
5 | {{ loop.index }}.{{ i }}{{ foo.bar }} | ||
6 | {% endfor %} | ||
7 | --DATA-- | ||
8 | return array('foo' => array('bar' => 'X')) | ||
9 | --CONFIG-- | ||
10 | return array('strict_variables' => false) | ||
11 | --EXPECT-- | ||
12 | 1.1X | ||
13 | 2.3X | ||
14 | 3.5X | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test deleted file mode 100644 index ddc69307..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag keeps the context safe | ||
3 | --TEMPLATE-- | ||
4 | {% for item in items %} | ||
5 | {% for item in items %} | ||
6 | * {{ item }} | ||
7 | {% endfor %} | ||
8 | * {{ item }} | ||
9 | {% endfor %} | ||
10 | --DATA-- | ||
11 | return array('items' => array('a', 'b')) | ||
12 | --EXPECT-- | ||
13 | * a | ||
14 | * b | ||
15 | * a | ||
16 | * a | ||
17 | * b | ||
18 | * b | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test deleted file mode 100644 index 20ccc880..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag can use an "else" clause | ||
3 | --TEMPLATE-- | ||
4 | {% for item in items %} | ||
5 | * {{ item }} | ||
6 | {% else %} | ||
7 | no item | ||
8 | {% endfor %} | ||
9 | --DATA-- | ||
10 | return array('items' => array('a', 'b')) | ||
11 | --EXPECT-- | ||
12 | * a | ||
13 | * b | ||
14 | --DATA-- | ||
15 | return array('items' => array()) | ||
16 | --EXPECT-- | ||
17 | no item | ||
18 | --DATA-- | ||
19 | return array() | ||
20 | --CONFIG-- | ||
21 | return array('strict_variables' => false) | ||
22 | --EXPECT-- | ||
23 | no item | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test deleted file mode 100644 index 49fb9ca6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag does not reset inner variables | ||
3 | --TEMPLATE-- | ||
4 | {% for i in 1..2 %} | ||
5 | {% for j in 0..2 %} | ||
6 | {{k}}{% set k = k+1 %} {{ loop.parent.loop.index }} | ||
7 | {% endfor %} | ||
8 | {% endfor %} | ||
9 | --DATA-- | ||
10 | return array('k' => 0) | ||
11 | --EXPECT-- | ||
12 | 0 1 | ||
13 | 1 1 | ||
14 | 2 1 | ||
15 | 3 2 | ||
16 | 4 2 | ||
17 | 5 2 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test deleted file mode 100644 index 4e22cb47..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag can iterate over keys | ||
3 | --TEMPLATE-- | ||
4 | {% for key in items|keys %} | ||
5 | * {{ key }} | ||
6 | {% endfor %} | ||
7 | --DATA-- | ||
8 | return array('items' => array('a', 'b')) | ||
9 | --EXPECT-- | ||
10 | * 0 | ||
11 | * 1 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test deleted file mode 100644 index 4c211689..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag can iterate over keys and values | ||
3 | --TEMPLATE-- | ||
4 | {% for key, item in items %} | ||
5 | * {{ key }}/{{ item }} | ||
6 | {% endfor %} | ||
7 | --DATA-- | ||
8 | return array('items' => array('a', 'b')) | ||
9 | --EXPECT-- | ||
10 | * 0/a | ||
11 | * 1/b | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test deleted file mode 100644 index 93bc76a1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag adds a loop variable to the context | ||
3 | --TEMPLATE-- | ||
4 | {% for item in items %} | ||
5 | * {{ loop.index }}/{{ loop.index0 }} | ||
6 | * {{ loop.revindex }}/{{ loop.revindex0 }} | ||
7 | * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} | ||
8 | |||
9 | {% endfor %} | ||
10 | --DATA-- | ||
11 | return array('items' => array('a', 'b')) | ||
12 | --EXPECT-- | ||
13 | * 1/0 | ||
14 | * 2/1 | ||
15 | * 1//2 | ||
16 | |||
17 | * 2/1 | ||
18 | * 1/0 | ||
19 | * /1/2 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test deleted file mode 100644 index 58af2c32..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag adds a loop variable to the context locally | ||
3 | --TEMPLATE-- | ||
4 | {% for item in items %} | ||
5 | {% endfor %} | ||
6 | {% if loop is not defined %}WORKS{% endif %} | ||
7 | --DATA-- | ||
8 | return array('items' => array()) | ||
9 | --EXPECT-- | ||
10 | WORKS | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test deleted file mode 100644 index 4301ef2f..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag | ||
3 | --TEMPLATE-- | ||
4 | {% for i, item in items if i > 0 %} | ||
5 | {{ loop.last }} | ||
6 | {% endfor %} | ||
7 | --DATA-- | ||
8 | return array('items' => array('a', 'b')) | ||
9 | --EXCEPTION-- | ||
10 | Twig_Error_Syntax: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test deleted file mode 100644 index c7e723a5..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag | ||
3 | --TEMPLATE-- | ||
4 | {% for i, item in items if loop.last > 0 %} | ||
5 | {% endfor %} | ||
6 | --DATA-- | ||
7 | return array('items' => array('a', 'b')) | ||
8 | --EXCEPTION-- | ||
9 | Twig_Error_Syntax: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test deleted file mode 100644 index f8b9f6bc..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag can use an "else" clause | ||
3 | --TEMPLATE-- | ||
4 | {% for item in items %} | ||
5 | {% for item in items1 %} | ||
6 | * {{ item }} | ||
7 | {% else %} | ||
8 | no {{ item }} | ||
9 | {% endfor %} | ||
10 | {% else %} | ||
11 | no item1 | ||
12 | {% endfor %} | ||
13 | --DATA-- | ||
14 | return array('items' => array('a', 'b'), 'items1' => array()) | ||
15 | --EXPECT-- | ||
16 | no a | ||
17 | no b | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test deleted file mode 100644 index 50344379..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag iterates over iterable objects | ||
3 | --TEMPLATE-- | ||
4 | {% for item in items %} | ||
5 | * {{ item }} | ||
6 | * {{ loop.index }}/{{ loop.index0 }} | ||
7 | * {{ loop.first }} | ||
8 | |||
9 | {% endfor %} | ||
10 | |||
11 | {% for key, value in items %} | ||
12 | * {{ key }}/{{ value }} | ||
13 | {% endfor %} | ||
14 | |||
15 | {% for key in items|keys %} | ||
16 | * {{ key }} | ||
17 | {% endfor %} | ||
18 | --DATA-- | ||
19 | class ItemsIterator implements Iterator | ||
20 | { | ||
21 | protected $values = array('foo' => 'bar', 'bar' => 'foo'); | ||
22 | public function current() { return current($this->values); } | ||
23 | public function key() { return key($this->values); } | ||
24 | public function next() { return next($this->values); } | ||
25 | public function rewind() { return reset($this->values); } | ||
26 | public function valid() { return false !== current($this->values); } | ||
27 | } | ||
28 | return array('items' => new ItemsIterator()) | ||
29 | --EXPECT-- | ||
30 | * bar | ||
31 | * 1/0 | ||
32 | * 1 | ||
33 | |||
34 | * foo | ||
35 | * 2/1 | ||
36 | * | ||
37 | |||
38 | |||
39 | * foo/bar | ||
40 | * bar/foo | ||
41 | |||
42 | * foo | ||
43 | * bar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test deleted file mode 100644 index 4a1ff611..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag iterates over iterable and countable objects | ||
3 | --TEMPLATE-- | ||
4 | {% for item in items %} | ||
5 | * {{ item }} | ||
6 | * {{ loop.index }}/{{ loop.index0 }} | ||
7 | * {{ loop.revindex }}/{{ loop.revindex0 }} | ||
8 | * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} | ||
9 | |||
10 | {% endfor %} | ||
11 | |||
12 | {% for key, value in items %} | ||
13 | * {{ key }}/{{ value }} | ||
14 | {% endfor %} | ||
15 | |||
16 | {% for key in items|keys %} | ||
17 | * {{ key }} | ||
18 | {% endfor %} | ||
19 | --DATA-- | ||
20 | class ItemsIteratorCountable implements Iterator, Countable | ||
21 | { | ||
22 | protected $values = array('foo' => 'bar', 'bar' => 'foo'); | ||
23 | public function current() { return current($this->values); } | ||
24 | public function key() { return key($this->values); } | ||
25 | public function next() { return next($this->values); } | ||
26 | public function rewind() { return reset($this->values); } | ||
27 | public function valid() { return false !== current($this->values); } | ||
28 | public function count() { return count($this->values); } | ||
29 | } | ||
30 | return array('items' => new ItemsIteratorCountable()) | ||
31 | --EXPECT-- | ||
32 | * bar | ||
33 | * 1/0 | ||
34 | * 2/1 | ||
35 | * 1//2 | ||
36 | |||
37 | * foo | ||
38 | * 2/1 | ||
39 | * 1/0 | ||
40 | * /1/2 | ||
41 | |||
42 | |||
43 | * foo/bar | ||
44 | * bar/foo | ||
45 | |||
46 | * foo | ||
47 | * bar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test deleted file mode 100644 index 17b2e222..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tags can be nested | ||
3 | --TEMPLATE-- | ||
4 | {% for key, item in items %} | ||
5 | * {{ key }} ({{ loop.length }}): | ||
6 | {% for value in item %} | ||
7 | * {{ value }} ({{ loop.length }}) | ||
8 | {% endfor %} | ||
9 | {% endfor %} | ||
10 | --DATA-- | ||
11 | return array('items' => array('a' => array('a1', 'a2', 'a3'), 'b' => array('b1'))) | ||
12 | --EXPECT-- | ||
13 | * a (2): | ||
14 | * a1 (3) | ||
15 | * a2 (3) | ||
16 | * a3 (3) | ||
17 | * b (2): | ||
18 | * b1 (1) | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test deleted file mode 100644 index 82f2ae8a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "for" tag iterates over item values | ||
3 | --TEMPLATE-- | ||
4 | {% for item in items %} | ||
5 | * {{ item }} | ||
6 | {% endfor %} | ||
7 | --DATA-- | ||
8 | return array('items' => array('a', 'b')) | ||
9 | --EXPECT-- | ||
10 | * a | ||
11 | * b | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test deleted file mode 100644 index 5f5da0ec..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | global variables | ||
3 | --TEMPLATE-- | ||
4 | {% include "included.twig" %} | ||
5 | {% from "included.twig" import foobar %} | ||
6 | {{ foobar() }} | ||
7 | --TEMPLATE(included.twig)-- | ||
8 | {% macro foobar() %} | ||
9 | called foobar | ||
10 | {% endmacro %} | ||
11 | --DATA-- | ||
12 | return array(); | ||
13 | --EXPECT-- | ||
14 | called foobar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test deleted file mode 100644 index c1c3d276..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "if" creates a condition | ||
3 | --TEMPLATE-- | ||
4 | {% if a is defined %} | ||
5 | {{ a }} | ||
6 | {% elseif b is defined %} | ||
7 | {{ b }} | ||
8 | {% else %} | ||
9 | NOTHING | ||
10 | {% endif %} | ||
11 | --DATA-- | ||
12 | return array('a' => 'a') | ||
13 | --EXPECT-- | ||
14 | a | ||
15 | --DATA-- | ||
16 | return array('b' => 'b') | ||
17 | --EXPECT-- | ||
18 | b | ||
19 | --DATA-- | ||
20 | return array() | ||
21 | --EXPECT-- | ||
22 | NOTHING | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test deleted file mode 100644 index edfb73df..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "if" takes an expression as a test | ||
3 | --TEMPLATE-- | ||
4 | {% if a < 2 %} | ||
5 | A1 | ||
6 | {% elseif a > 10 %} | ||
7 | A2 | ||
8 | {% else %} | ||
9 | A3 | ||
10 | {% endif %} | ||
11 | --DATA-- | ||
12 | return array('a' => 1) | ||
13 | --EXPECT-- | ||
14 | A1 | ||
15 | --DATA-- | ||
16 | return array('a' => 12) | ||
17 | --EXPECT-- | ||
18 | A2 | ||
19 | --DATA-- | ||
20 | return array('a' => 7) | ||
21 | --EXPECT-- | ||
22 | A3 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test deleted file mode 100644 index 8fe1a6c1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag | ||
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 | BAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test deleted file mode 100644 index eaeeb112..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag 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 | BAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test deleted file mode 100644 index 24aed06d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag | ||
3 | --TEMPLATE-- | ||
4 | {% include ["foo.twig", "bar.twig"] ignore missing %} | ||
5 | {% include "foo.twig" ignore missing %} | ||
6 | {% include "foo.twig" ignore missing with {} %} | ||
7 | {% include "foo.twig" ignore missing with {} only %} | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXPECT-- | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test deleted file mode 100644 index f25e8715..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag | ||
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/tags/include/missing_nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test deleted file mode 100644 index 86c18644..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag | ||
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/tags/include/only.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test deleted file mode 100644 index 77760a09..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag accept variables and only | ||
3 | --TEMPLATE-- | ||
4 | {% include "foo.twig" %} | ||
5 | {% include "foo.twig" only %} | ||
6 | {% include "foo.twig" with {'foo1': 'bar'} %} | ||
7 | {% include "foo.twig" with {'foo1': 'bar'} only %} | ||
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/tags/include/template_instance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test deleted file mode 100644 index 6ba064a3..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag 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/tags/include/templates_as_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test deleted file mode 100644 index ab670ee0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag | ||
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/tags/include/with_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test deleted file mode 100644 index 41384ac7..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "include" tag accept variables | ||
3 | --TEMPLATE-- | ||
4 | {% include "foo.twig" with {'foo': 'bar'} %} | ||
5 | {% include "foo.twig" with 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/tags/inheritance/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test deleted file mode 100644 index 0778a4b4..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends "foo.twig" %} | ||
5 | |||
6 | {% block content %} | ||
7 | FOO | ||
8 | {% endblock %} | ||
9 | --TEMPLATE(foo.twig)-- | ||
10 | {% block content %}{% endblock %} | ||
11 | --DATA-- | ||
12 | return array() | ||
13 | --EXPECT-- | ||
14 | FOO | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test deleted file mode 100644 index 8576e773..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends standalone ? foo : 'bar.twig' %} | ||
5 | |||
6 | {% block content %}{{ parent() }}FOO{% endblock %} | ||
7 | --TEMPLATE(foo.twig)-- | ||
8 | {% block content %}FOO{% endblock %} | ||
9 | --TEMPLATE(bar.twig)-- | ||
10 | {% block content %}BAR{% endblock %} | ||
11 | --DATA-- | ||
12 | return array('foo' => 'foo.twig', 'standalone' => true) | ||
13 | --EXPECT-- | ||
14 | FOOFOO | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test deleted file mode 100644 index ee06ddce..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends foo %} | ||
5 | |||
6 | {% block content %} | ||
7 | FOO | ||
8 | {% endblock %} | ||
9 | --TEMPLATE(foo.twig)-- | ||
10 | {% block content %}{% endblock %} | ||
11 | --DATA-- | ||
12 | return array('foo' => 'foo.twig') | ||
13 | --EXPECT-- | ||
14 | FOO | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test deleted file mode 100644 index 784f3571..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends "foo.twig" %} | ||
5 | --TEMPLATE(foo.twig)-- | ||
6 | {% block content %}FOO{% endblock %} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
10 | FOO | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test deleted file mode 100644 index a1cb1ce8..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends ["foo.twig", "bar.twig"] %} | ||
5 | --TEMPLATE(bar.twig)-- | ||
6 | {% block content %} | ||
7 | foo | ||
8 | {% endblock %} | ||
9 | --DATA-- | ||
10 | return array() | ||
11 | --EXPECT-- | ||
12 | foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test deleted file mode 100644 index dfc2b6c4..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends "layout.twig" %}{% block content %}{{ parent() }}index {% endblock %} | ||
5 | --TEMPLATE(layout.twig)-- | ||
6 | {% extends "base.twig" %}{% block content %}{{ parent() }}layout {% endblock %} | ||
7 | --TEMPLATE(base.twig)-- | ||
8 | {% block content %}base {% endblock %} | ||
9 | --DATA-- | ||
10 | return array() | ||
11 | --EXPECT-- | ||
12 | base layout index | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test deleted file mode 100644 index faca9259..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "block" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends "foo.twig" %} | ||
5 | |||
6 | {% block content %} | ||
7 | {% block subcontent %} | ||
8 | {% block subsubcontent %} | ||
9 | SUBSUBCONTENT | ||
10 | {% endblock %} | ||
11 | {% endblock %} | ||
12 | {% endblock %} | ||
13 | --TEMPLATE(foo.twig)-- | ||
14 | {% block content %} | ||
15 | {% block subcontent %} | ||
16 | SUBCONTENT | ||
17 | {% endblock %} | ||
18 | {% endblock %} | ||
19 | --DATA-- | ||
20 | return array() | ||
21 | --EXPECT-- | ||
22 | SUBSUBCONTENT | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test deleted file mode 100644 index 0ad11d0c..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "block" tag | ||
3 | --TEMPLATE-- | ||
4 | {% block content %} | ||
5 | CONTENT | ||
6 | {%- block subcontent -%} | ||
7 | SUBCONTENT | ||
8 | {%- endblock -%} | ||
9 | ENDCONTENT | ||
10 | {% endblock %} | ||
11 | --TEMPLATE(foo.twig)-- | ||
12 | --DATA-- | ||
13 | return array() | ||
14 | --EXPECT-- | ||
15 | CONTENTSUBCONTENTENDCONTENT | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test deleted file mode 100644 index 71e3cdfd..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends "layout.twig" %} | ||
5 | {% block inside %}INSIDE{% endblock inside %} | ||
6 | --TEMPLATE(layout.twig)-- | ||
7 | {% extends "base.twig" %} | ||
8 | {% block body %} | ||
9 | {% block inside '' %} | ||
10 | {% endblock body %} | ||
11 | --TEMPLATE(base.twig)-- | ||
12 | {% block body '' %} | ||
13 | --DATA-- | ||
14 | return array() | ||
15 | --EXPECT-- | ||
16 | INSIDE | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test deleted file mode 100644 index 4f975db8..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends "foo.twig" %} | ||
5 | |||
6 | {% block content %}{{ parent() }}FOO{{ parent() }}{% endblock %} | ||
7 | --TEMPLATE(foo.twig)-- | ||
8 | {% block content %}BAR{% endblock %} | ||
9 | --DATA-- | ||
10 | return array() | ||
11 | --EXPECT-- | ||
12 | BARFOOBAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test deleted file mode 100644 index a8bc90ce..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends foo ? 'foo.twig' : 'bar.twig' %} | ||
5 | --TEMPLATE(foo.twig)-- | ||
6 | FOO | ||
7 | --TEMPLATE(bar.twig)-- | ||
8 | BAR | ||
9 | --DATA-- | ||
10 | return array('foo' => true) | ||
11 | --EXPECT-- | ||
12 | FOO | ||
13 | --DATA-- | ||
14 | return array('foo' => false) | ||
15 | --EXPECT-- | ||
16 | BAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test deleted file mode 100644 index c9e86b1a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% block content %} | ||
5 | {% extends "foo.twig" %} | ||
6 | {% endblock %} | ||
7 | --EXCEPTION-- | ||
8 | Twig_Error_Syntax: Cannot extend from a block in "index.twig" at line 3 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test deleted file mode 100644 index 62816713..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends "base.twig" %} | ||
5 | {% block content %}{% include "included.twig" %}{% endblock %} | ||
6 | |||
7 | {% block footer %}Footer{% endblock %} | ||
8 | --TEMPLATE(included.twig)-- | ||
9 | {% extends "base.twig" %} | ||
10 | {% block content %}Included Content{% endblock %} | ||
11 | --TEMPLATE(base.twig)-- | ||
12 | {% block content %}Default Content{% endblock %} | ||
13 | |||
14 | {% block footer %}Default Footer{% endblock %} | ||
15 | --DATA-- | ||
16 | return array() | ||
17 | --EXPECT-- | ||
18 | Included Content | ||
19 | Default Footer | ||
20 | Footer | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test deleted file mode 100644 index 71e7c208..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag | ||
3 | --TEMPLATE-- | ||
4 | {% extends "foo.twig" %} | ||
5 | |||
6 | {% block content %} | ||
7 | {% block inside %} | ||
8 | INSIDE OVERRIDDEN | ||
9 | {% endblock %} | ||
10 | |||
11 | BEFORE | ||
12 | {{ parent() }} | ||
13 | AFTER | ||
14 | {% endblock %} | ||
15 | --TEMPLATE(foo.twig)-- | ||
16 | {% block content %} | ||
17 | BAR | ||
18 | {% endblock %} | ||
19 | --DATA-- | ||
20 | return array() | ||
21 | --EXPECT-- | ||
22 | |||
23 | INSIDE OVERRIDDEN | ||
24 | |||
25 | BEFORE | ||
26 | BAR | ||
27 | |||
28 | AFTER | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test deleted file mode 100644 index a9eaa4c1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "parent" tag | ||
3 | --TEMPLATE-- | ||
4 | {% block content %} | ||
5 | {{ parent() }} | ||
6 | {% endblock %} | ||
7 | --EXCEPTION-- | ||
8 | Twig_Error_Syntax: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test deleted file mode 100644 index 63c73055..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "parent" tag | ||
3 | --TEMPLATE-- | ||
4 | {% use 'foo.twig' %} | ||
5 | |||
6 | {% block content %} | ||
7 | {{ parent() }} | ||
8 | {% endblock %} | ||
9 | --TEMPLATE(foo.twig)-- | ||
10 | {% block content %}BAR{% endblock %} | ||
11 | --DATA-- | ||
12 | return array() | ||
13 | --EXPECT-- | ||
14 | BAR | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test deleted file mode 100644 index d1876a52..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "extends" tag accepts Twig_Template instance | ||
3 | --TEMPLATE-- | ||
4 | {% extends foo %} | ||
5 | |||
6 | {% block content %} | ||
7 | {{ parent() }}FOO | ||
8 | {% endblock %} | ||
9 | --TEMPLATE(foo.twig)-- | ||
10 | {% block content %}BAR{% endblock %} | ||
11 | --DATA-- | ||
12 | return array('foo' => $twig->loadTemplate('foo.twig')) | ||
13 | --EXPECT-- | ||
14 | BARFOO | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test deleted file mode 100644 index 8f9ece7c..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "parent" function | ||
3 | --TEMPLATE-- | ||
4 | {% extends "parent.twig" %} | ||
5 | |||
6 | {% use "use1.twig" %} | ||
7 | {% use "use2.twig" %} | ||
8 | |||
9 | {% block content_parent %} | ||
10 | {{ parent() }} | ||
11 | {% endblock %} | ||
12 | |||
13 | {% block content_use1 %} | ||
14 | {{ parent() }} | ||
15 | {% endblock %} | ||
16 | |||
17 | {% block content_use2 %} | ||
18 | {{ parent() }} | ||
19 | {% endblock %} | ||
20 | |||
21 | {% block content %} | ||
22 | {{ block('content_use1_only') }} | ||
23 | {{ block('content_use2_only') }} | ||
24 | {% endblock %} | ||
25 | --TEMPLATE(parent.twig)-- | ||
26 | {% block content_parent 'content_parent' %} | ||
27 | {% block content_use1 'content_parent' %} | ||
28 | {% block content_use2 'content_parent' %} | ||
29 | {% block content '' %} | ||
30 | --TEMPLATE(use1.twig)-- | ||
31 | {% block content_use1 'content_use1' %} | ||
32 | {% block content_use2 'content_use1' %} | ||
33 | {% block content_use1_only 'content_use1_only' %} | ||
34 | --TEMPLATE(use2.twig)-- | ||
35 | {% block content_use2 'content_use2' %} | ||
36 | {% block content_use2_only 'content_use2_only' %} | ||
37 | --DATA-- | ||
38 | return array() | ||
39 | --EXPECT-- | ||
40 | content_parent | ||
41 | content_use1 | ||
42 | content_use2 | ||
43 | content_use1_only | ||
44 | content_use2_only | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test deleted file mode 100644 index eef0c10d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "macro" tag | ||
3 | --TEMPLATE-- | ||
4 | {% import _self as macros %} | ||
5 | |||
6 | {{ macros.input('username') }} | ||
7 | {{ macros.input('password', null, 'password', 1) }} | ||
8 | |||
9 | {% macro input(name, value, type, size) %} | ||
10 | <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}"> | ||
11 | {% endmacro %} | ||
12 | --DATA-- | ||
13 | return array() | ||
14 | --EXPECT-- | ||
15 | <input type="text" name="username" value="" size="20"> | ||
16 | |||
17 | <input type="password" name="password" value="" size="1"> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test deleted file mode 100644 index ae6203bb..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "macro" tag supports name for endmacro | ||
3 | --TEMPLATE-- | ||
4 | {% import _self as macros %} | ||
5 | |||
6 | {{ macros.foo() }} | ||
7 | {{ macros.bar() }} | ||
8 | |||
9 | {% macro foo() %}foo{% endmacro %} | ||
10 | {% macro bar() %}bar{% endmacro bar %} | ||
11 | --DATA-- | ||
12 | return array() | ||
13 | --EXPECT-- | ||
14 | foo | ||
15 | bar | ||
16 | |||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test deleted file mode 100644 index 5cd3dae6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "macro" tag | ||
3 | --TEMPLATE-- | ||
4 | {% import 'forms.twig' as forms %} | ||
5 | |||
6 | {{ forms.input('username') }} | ||
7 | {{ forms.input('password', null, 'password', 1) }} | ||
8 | --TEMPLATE(forms.twig)-- | ||
9 | {% macro input(name, value, type, size) %} | ||
10 | <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}"> | ||
11 | {% endmacro %} | ||
12 | --DATA-- | ||
13 | return array() | ||
14 | --EXPECT-- | ||
15 | <input type="text" name="username" value="" size="20"> | ||
16 | |||
17 | <input type="password" name="password" value="" size="1"> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test deleted file mode 100644 index 205f5918..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "macro" tag | ||
3 | --TEMPLATE-- | ||
4 | {% from 'forms.twig' import foo %} | ||
5 | {% from 'forms.twig' import foo as foobar, bar %} | ||
6 | |||
7 | {{ foo('foo') }} | ||
8 | {{ foobar('foo') }} | ||
9 | {{ bar('foo') }} | ||
10 | --TEMPLATE(forms.twig)-- | ||
11 | {% macro foo(name) %}foo{{ name }}{% endmacro %} | ||
12 | {% macro bar(name) %}bar{{ name }}{% endmacro %} | ||
13 | --DATA-- | ||
14 | return array() | ||
15 | --EXPECT-- | ||
16 | foofoo | ||
17 | foofoo | ||
18 | barfoo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test deleted file mode 100644 index 6b371768..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "macro" tag | ||
3 | --TEMPLATE-- | ||
4 | {% from 'forms.twig' import foo %} | ||
5 | |||
6 | {{ foo('foo') }} | ||
7 | {{ foo() }} | ||
8 | --TEMPLATE(forms.twig)-- | ||
9 | {% macro foo(name) %}{{ name|default('foo') }}{{ global }}{% endmacro %} | ||
10 | --DATA-- | ||
11 | return array() | ||
12 | --EXPECT-- | ||
13 | fooglobal | ||
14 | fooglobal | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test deleted file mode 100644 index 17756cb6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "macro" tag | ||
3 | --TEMPLATE-- | ||
4 | {% import _self as forms %} | ||
5 | |||
6 | {{ forms.input('username') }} | ||
7 | {{ forms.input('password', null, 'password', 1) }} | ||
8 | |||
9 | {% macro input(name, value, type, size) %} | ||
10 | <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}"> | ||
11 | {% endmacro %} | ||
12 | --DATA-- | ||
13 | return array() | ||
14 | --EXPECT-- | ||
15 | <input type="text" name="username" value="" size="20"> | ||
16 | |||
17 | <input type="password" name="password" value="" size="1"> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test deleted file mode 100644 index 37217707..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "§" as a macro name | ||
3 | --TEMPLATE-- | ||
4 | {% import _self as macros %} | ||
5 | |||
6 | {{ macros.§('foo') }} | ||
7 | |||
8 | {% macro §(foo) %} | ||
9 | §{{ foo }}§ | ||
10 | {% endmacro %} | ||
11 | --DATA-- | ||
12 | return array() | ||
13 | --EXPECT-- | ||
14 | §foo§ | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test deleted file mode 100644 index 0445e853..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "raw" tag | ||
3 | --TEMPLATE-- | ||
4 | {% raw %} | ||
5 | {{ foo }} | ||
6 | {% endraw %} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
10 | {{ foo }} | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.test deleted file mode 100644 index 2fd9fb26..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "raw" tag | ||
3 | --TEMPLATE-- | ||
4 | {% raw %} | ||
5 | {{ foo }} | ||
6 | {% endverbatim %} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXCEPTION-- | ||
10 | Twig_Error_Syntax: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test deleted file mode 100644 index 352bb187..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.test +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "raw" tag | ||
3 | --TEMPLATE-- | ||
4 | 1*** | ||
5 | |||
6 | {%- raw %} | ||
7 | {{ 'bla' }} | ||
8 | {% endraw %} | ||
9 | |||
10 | 1*** | ||
11 | 2*** | ||
12 | |||
13 | {%- raw -%} | ||
14 | {{ 'bla' }} | ||
15 | {% endraw %} | ||
16 | |||
17 | 2*** | ||
18 | 3*** | ||
19 | |||
20 | {%- raw -%} | ||
21 | {{ 'bla' }} | ||
22 | {% endraw -%} | ||
23 | |||
24 | 3*** | ||
25 | 4*** | ||
26 | |||
27 | {%- raw -%} | ||
28 | {{ 'bla' }} | ||
29 | {%- endraw %} | ||
30 | |||
31 | 4*** | ||
32 | 5*** | ||
33 | |||
34 | {%- raw -%} | ||
35 | {{ 'bla' }} | ||
36 | {%- endraw -%} | ||
37 | |||
38 | 5*** | ||
39 | --DATA-- | ||
40 | return array() | ||
41 | --EXPECT-- | ||
42 | 1*** | ||
43 | {{ 'bla' }} | ||
44 | |||
45 | |||
46 | 1*** | ||
47 | 2***{{ 'bla' }} | ||
48 | |||
49 | |||
50 | 2*** | ||
51 | 3***{{ 'bla' }} | ||
52 | 3*** | ||
53 | 4***{{ 'bla' }} | ||
54 | |||
55 | 4*** | ||
56 | 5***{{ 'bla' }}5*** | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test deleted file mode 100644 index 683c59a0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --TEST-- | ||
2 | sandbox tag | ||
3 | --TEMPLATE-- | ||
4 | {%- sandbox %} | ||
5 | {%- include "foo.twig" %} | ||
6 | a | ||
7 | {%- endsandbox %} | ||
8 | --TEMPLATE(foo.twig)-- | ||
9 | foo | ||
10 | --EXCEPTION-- | ||
11 | Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test deleted file mode 100644 index 3dcfa88c..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | sandbox tag | ||
3 | --TEMPLATE-- | ||
4 | {%- sandbox %} | ||
5 | {%- include "foo.twig" %} | ||
6 | |||
7 | {% if 1 %} | ||
8 | {%- include "foo.twig" %} | ||
9 | {% endif %} | ||
10 | {%- endsandbox %} | ||
11 | --TEMPLATE(foo.twig)-- | ||
12 | foo | ||
13 | --EXCEPTION-- | ||
14 | Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test deleted file mode 100644 index de20f3db..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | --TEST-- | ||
2 | sandbox tag | ||
3 | --TEMPLATE-- | ||
4 | {%- sandbox %} | ||
5 | {%- include "foo.twig" %} | ||
6 | {%- endsandbox %} | ||
7 | |||
8 | {%- sandbox %} | ||
9 | {%- include "foo.twig" %} | ||
10 | {%- include "foo.twig" %} | ||
11 | {%- endsandbox %} | ||
12 | |||
13 | {%- sandbox %}{% include "foo.twig" %}{% endsandbox %} | ||
14 | --TEMPLATE(foo.twig)-- | ||
15 | foo | ||
16 | --DATA-- | ||
17 | return array() | ||
18 | --EXPECT-- | ||
19 | foo | ||
20 | foo | ||
21 | foo | ||
22 | foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test deleted file mode 100644 index a5a9f830..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "set" tag | ||
3 | --TEMPLATE-- | ||
4 | {% set foo = 'foo' %} | ||
5 | {% set bar = 'foo<br />' %} | ||
6 | |||
7 | {{ foo }} | ||
8 | {{ bar }} | ||
9 | |||
10 | {% set foo, bar = 'foo', 'bar' %} | ||
11 | |||
12 | {{ foo }}{{ bar }} | ||
13 | --DATA-- | ||
14 | return array() | ||
15 | --EXPECT-- | ||
16 | foo | ||
17 | foo<br /> | ||
18 | |||
19 | |||
20 | foobar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test deleted file mode 100644 index ec657f00..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "set" tag block empty capture | ||
3 | --TEMPLATE-- | ||
4 | {% set foo %}{% endset %} | ||
5 | |||
6 | {% if foo %}FAIL{% endif %} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test deleted file mode 100644 index f156a1a7..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "set" tag block capture | ||
3 | --TEMPLATE-- | ||
4 | {% set foo %}f<br />o<br />o{% endset %} | ||
5 | |||
6 | {{ foo }} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
10 | f<br />o<br />o | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test deleted file mode 100644 index 8ff434a0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "set" tag | ||
3 | --TEMPLATE-- | ||
4 | {% set foo, bar = 'foo' ~ 'bar', 'bar' ~ 'foo' %} | ||
5 | |||
6 | {{ foo }} | ||
7 | {{ bar }} | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXPECT-- | ||
11 | foobar | ||
12 | barfoo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test deleted file mode 100644 index dd06dec2..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "spaceless" tag removes whites between HTML tags | ||
3 | --TEMPLATE-- | ||
4 | {% spaceless %} | ||
5 | |||
6 | <div> <div> foo </div> </div> | ||
7 | |||
8 | {% endspaceless %} | ||
9 | --DATA-- | ||
10 | return array() | ||
11 | --EXPECT-- | ||
12 | <div><div> foo </div></div> | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test deleted file mode 100644 index 789b4ba8..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "§" custom tag | ||
3 | --TEMPLATE-- | ||
4 | {% § %} | ||
5 | --DATA-- | ||
6 | return array() | ||
7 | --EXPECT-- | ||
8 | § | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test deleted file mode 100644 index 1d2273f8..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Whitespace trimming on tags. | ||
3 | --TEMPLATE-- | ||
4 | {{ 5 * '{#-'|length }} | ||
5 | {{ '{{-'|length * 5 + '{%-'|length }} | ||
6 | |||
7 | Trim on control tag: | ||
8 | {% for i in range(1, 9) -%} | ||
9 | {{ i }} | ||
10 | {%- endfor %} | ||
11 | |||
12 | |||
13 | Trim on output tag: | ||
14 | {% for i in range(1, 9) %} | ||
15 | {{- i -}} | ||
16 | {% endfor %} | ||
17 | |||
18 | |||
19 | Trim comments: | ||
20 | |||
21 | {#- Invisible -#} | ||
22 | |||
23 | After the comment. | ||
24 | |||
25 | Trim leading space: | ||
26 | {% if leading %} | ||
27 | |||
28 | {{- leading }} | ||
29 | {% endif %} | ||
30 | |||
31 | {%- if leading %} | ||
32 | {{- leading }} | ||
33 | |||
34 | {%- endif %} | ||
35 | |||
36 | |||
37 | Trim trailing space: | ||
38 | {% if trailing -%} | ||
39 | {{ trailing -}} | ||
40 | |||
41 | {% endif -%} | ||
42 | |||
43 | Combined: | ||
44 | |||
45 | {%- if both -%} | ||
46 | <ul> | ||
47 | <li> {{- both -}} </li> | ||
48 | </ul> | ||
49 | |||
50 | {%- endif -%} | ||
51 | |||
52 | end | ||
53 | --DATA-- | ||
54 | return array('leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both') | ||
55 | --EXPECT-- | ||
56 | 15 | ||
57 | 18 | ||
58 | |||
59 | Trim on control tag: | ||
60 | 123456789 | ||
61 | |||
62 | Trim on output tag: | ||
63 | 123456789 | ||
64 | |||
65 | Trim comments:After the comment. | ||
66 | |||
67 | Trim leading space: | ||
68 | leading space | ||
69 | leading space | ||
70 | |||
71 | Trim trailing space: | ||
72 | trailing spaceCombined:<ul> | ||
73 | <li>both</li> | ||
74 | </ul>end | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test deleted file mode 100644 index f887006f..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "use" tag | ||
3 | --TEMPLATE-- | ||
4 | {% use "blocks.twig" with content as foo %} | ||
5 | |||
6 | {{ block('foo') }} | ||
7 | --TEMPLATE(blocks.twig)-- | ||
8 | {% block content 'foo' %} | ||
9 | --DATA-- | ||
10 | return array() | ||
11 | --EXPECT-- | ||
12 | foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test deleted file mode 100644 index 7364d76d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "use" tag | ||
3 | --TEMPLATE-- | ||
4 | {% use "blocks.twig" %} | ||
5 | |||
6 | {{ block('content') }} | ||
7 | --TEMPLATE(blocks.twig)-- | ||
8 | {% block content 'foo' %} | ||
9 | --DATA-- | ||
10 | return array() | ||
11 | --EXPECT-- | ||
12 | foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test deleted file mode 100644 index b551a1e6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "use" tag | ||
3 | --TEMPLATE-- | ||
4 | {% use "foo.twig" %} | ||
5 | |||
6 | {{ block('content') }} | ||
7 | {{ block('foo') }} | ||
8 | {{ block('bar') }} | ||
9 | --TEMPLATE(foo.twig)-- | ||
10 | {% use "bar.twig" %} | ||
11 | |||
12 | {% block content 'foo' %} | ||
13 | {% block foo 'foo' %} | ||
14 | --TEMPLATE(bar.twig)-- | ||
15 | {% block content 'bar' %} | ||
16 | {% block bar 'bar' %} | ||
17 | --DATA-- | ||
18 | return array() | ||
19 | --EXPECT-- | ||
20 | foo | ||
21 | foo | ||
22 | bar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test deleted file mode 100644 index 05cca682..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "use" tag | ||
3 | --TEMPLATE-- | ||
4 | {% use "foo.twig" %} | ||
5 | --TEMPLATE(foo.twig)-- | ||
6 | {% use "bar.twig" %} | ||
7 | --TEMPLATE(bar.twig)-- | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXPECT-- | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test deleted file mode 100644 index 198be0c5..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "use" tag | ||
3 | --TEMPLATE-- | ||
4 | {% use "foo.twig" %} | ||
5 | {% use "bar.twig" %} | ||
6 | |||
7 | {{ block('content') }} | ||
8 | {{ block('foo') }} | ||
9 | {{ block('bar') }} | ||
10 | --TEMPLATE(foo.twig)-- | ||
11 | {% block content 'foo' %} | ||
12 | {% block foo 'foo' %} | ||
13 | --TEMPLATE(bar.twig)-- | ||
14 | {% block content 'bar' %} | ||
15 | {% block bar 'bar' %} | ||
16 | --DATA-- | ||
17 | return array() | ||
18 | --EXPECT-- | ||
19 | bar | ||
20 | foo | ||
21 | bar | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test deleted file mode 100644 index 8de871a8..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "use" tag | ||
3 | --TEMPLATE-- | ||
4 | {% use "foo.twig" with content as foo_content %} | ||
5 | {% use "bar.twig" %} | ||
6 | |||
7 | {{ block('content') }} | ||
8 | {{ block('foo') }} | ||
9 | {{ block('bar') }} | ||
10 | {{ block('foo_content') }} | ||
11 | --TEMPLATE(foo.twig)-- | ||
12 | {% block content 'foo' %} | ||
13 | {% block foo 'foo' %} | ||
14 | --TEMPLATE(bar.twig)-- | ||
15 | {% block content 'bar' %} | ||
16 | {% block bar 'bar' %} | ||
17 | --DATA-- | ||
18 | return array() | ||
19 | --EXPECT-- | ||
20 | bar | ||
21 | foo | ||
22 | bar | ||
23 | foo | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test deleted file mode 100644 index a95be557..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "verbatim" tag | ||
3 | --TEMPLATE-- | ||
4 | {% verbatim %} | ||
5 | {{ foo }} | ||
6 | {% endverbatim %} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXPECT-- | ||
10 | {{ foo }} | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test deleted file mode 100644 index 941dddcc..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "verbatim" tag | ||
3 | --TEMPLATE-- | ||
4 | {% verbatim %} | ||
5 | {{ foo }} | ||
6 | {% endraw %} | ||
7 | --DATA-- | ||
8 | return array() | ||
9 | --EXCEPTION-- | ||
10 | Twig_Error_Syntax: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test deleted file mode 100644 index eb610444..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "verbatim" tag | ||
3 | --TEMPLATE-- | ||
4 | 1*** | ||
5 | |||
6 | {%- verbatim %} | ||
7 | {{ 'bla' }} | ||
8 | {% endverbatim %} | ||
9 | |||
10 | 1*** | ||
11 | 2*** | ||
12 | |||
13 | {%- verbatim -%} | ||
14 | {{ 'bla' }} | ||
15 | {% endverbatim %} | ||
16 | |||
17 | 2*** | ||
18 | 3*** | ||
19 | |||
20 | {%- verbatim -%} | ||
21 | {{ 'bla' }} | ||
22 | {% endverbatim -%} | ||
23 | |||
24 | 3*** | ||
25 | 4*** | ||
26 | |||
27 | {%- verbatim -%} | ||
28 | {{ 'bla' }} | ||
29 | {%- endverbatim %} | ||
30 | |||
31 | 4*** | ||
32 | 5*** | ||
33 | |||
34 | {%- verbatim -%} | ||
35 | {{ 'bla' }} | ||
36 | {%- endverbatim -%} | ||
37 | |||
38 | 5*** | ||
39 | --DATA-- | ||
40 | return array() | ||
41 | --EXPECT-- | ||
42 | 1*** | ||
43 | {{ 'bla' }} | ||
44 | |||
45 | |||
46 | 1*** | ||
47 | 2***{{ 'bla' }} | ||
48 | |||
49 | |||
50 | 2*** | ||
51 | 3***{{ 'bla' }} | ||
52 | 3*** | ||
53 | 4***{{ 'bla' }} | ||
54 | |||
55 | 4*** | ||
56 | 5***{{ 'bla' }}5*** | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test deleted file mode 100644 index 1429d375..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | --TEST-- | ||
2 | array index test | ||
3 | --TEMPLATE-- | ||
4 | {% for key, value in days %} | ||
5 | {{ key }} | ||
6 | {% endfor %} | ||
7 | --DATA-- | ||
8 | return array('days' => array( | ||
9 | 1 => array('money' => 9), | ||
10 | 2 => array('money' => 21), | ||
11 | 3 => array('money' => 38), | ||
12 | 4 => array('money' => 6), | ||
13 | 18 => array('money' => 6), | ||
14 | 19 => array('money' => 3), | ||
15 | 31 => array('money' => 11), | ||
16 | )); | ||
17 | --EXPECT-- | ||
18 | 1 | ||
19 | 2 | ||
20 | 3 | ||
21 | 4 | ||
22 | 18 | ||
23 | 19 | ||
24 | 31 | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test deleted file mode 100644 index 60218ac0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "const" test | ||
3 | --TEMPLATE-- | ||
4 | {{ 8 is constant('E_NOTICE') ? 'ok' : 'no' }} | ||
5 | {{ 'bar' is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} | ||
6 | {{ value is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} | ||
7 | {{ 2 is constant('ARRAY_AS_PROPS', object) ? 'ok' : 'no' }} | ||
8 | --DATA-- | ||
9 | return array('value' => 'bar', 'object' => new ArrayObject(array('hi'))); | ||
10 | --EXPECT-- | ||
11 | ok | ||
12 | ok | ||
13 | ok | ||
14 | ok \ No newline at end of file | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test deleted file mode 100644 index cbfe03de..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test +++ /dev/null | |||
@@ -1,108 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "defined" test | ||
3 | --TEMPLATE-- | ||
4 | {{ definedVar is defined ? 'ok' : 'ko' }} | ||
5 | {{ definedVar is not defined ? 'ko' : 'ok' }} | ||
6 | {{ undefinedVar is defined ? 'ko' : 'ok' }} | ||
7 | {{ undefinedVar is not defined ? 'ok' : 'ko' }} | ||
8 | {{ zeroVar is defined ? 'ok' : 'ko' }} | ||
9 | {{ nullVar is defined ? 'ok' : 'ko' }} | ||
10 | {{ nested.definedVar is defined ? 'ok' : 'ko' }} | ||
11 | {{ nested['definedVar'] is defined ? 'ok' : 'ko' }} | ||
12 | {{ nested.definedVar is not defined ? 'ko' : 'ok' }} | ||
13 | {{ nested.undefinedVar is defined ? 'ko' : 'ok' }} | ||
14 | {{ nested['undefinedVar'] is defined ? 'ko' : 'ok' }} | ||
15 | {{ nested.undefinedVar is not defined ? 'ok' : 'ko' }} | ||
16 | {{ nested.zeroVar is defined ? 'ok' : 'ko' }} | ||
17 | {{ nested.nullVar is defined ? 'ok' : 'ko' }} | ||
18 | {{ nested.definedArray.0 is defined ? 'ok' : 'ko' }} | ||
19 | {{ nested['definedArray'][0] is defined ? 'ok' : 'ko' }} | ||
20 | {{ object.foo is defined ? 'ok' : 'ko' }} | ||
21 | {{ object.undefinedMethod is defined ? 'ko' : 'ok' }} | ||
22 | {{ object.getFoo() is defined ? 'ok' : 'ko' }} | ||
23 | {{ object.getFoo('a') is defined ? 'ok' : 'ko' }} | ||
24 | {{ object.undefinedMethod() is defined ? 'ko' : 'ok' }} | ||
25 | {{ object.undefinedMethod('a') is defined ? 'ko' : 'ok' }} | ||
26 | {{ object.self.foo is defined ? 'ok' : 'ko' }} | ||
27 | {{ object.self.undefinedMethod is defined ? 'ko' : 'ok' }} | ||
28 | {{ object.undefinedMethod.self is defined ? 'ko' : 'ok' }} | ||
29 | --DATA-- | ||
30 | return array( | ||
31 | 'definedVar' => 'defined', | ||
32 | 'zeroVar' => 0, | ||
33 | 'nullVar' => null, | ||
34 | 'nested' => array( | ||
35 | 'definedVar' => 'defined', | ||
36 | 'zeroVar' => 0, | ||
37 | 'nullVar' => null, | ||
38 | 'definedArray' => array(0), | ||
39 | ), | ||
40 | 'object' => new TwigTestFoo(), | ||
41 | ); | ||
42 | --EXPECT-- | ||
43 | ok | ||
44 | ok | ||
45 | ok | ||
46 | ok | ||
47 | ok | ||
48 | ok | ||
49 | ok | ||
50 | ok | ||
51 | ok | ||
52 | ok | ||
53 | ok | ||
54 | ok | ||
55 | ok | ||
56 | ok | ||
57 | ok | ||
58 | ok | ||
59 | ok | ||
60 | ok | ||
61 | ok | ||
62 | ok | ||
63 | ok | ||
64 | ok | ||
65 | ok | ||
66 | ok | ||
67 | ok | ||
68 | --DATA-- | ||
69 | return array( | ||
70 | 'definedVar' => 'defined', | ||
71 | 'zeroVar' => 0, | ||
72 | 'nullVar' => null, | ||
73 | 'nested' => array( | ||
74 | 'definedVar' => 'defined', | ||
75 | 'zeroVar' => 0, | ||
76 | 'nullVar' => null, | ||
77 | 'definedArray' => array(0), | ||
78 | ), | ||
79 | 'object' => new TwigTestFoo(), | ||
80 | ); | ||
81 | --CONFIG-- | ||
82 | return array('strict_variables' => false) | ||
83 | --EXPECT-- | ||
84 | ok | ||
85 | ok | ||
86 | ok | ||
87 | ok | ||
88 | ok | ||
89 | ok | ||
90 | ok | ||
91 | ok | ||
92 | ok | ||
93 | ok | ||
94 | ok | ||
95 | ok | ||
96 | ok | ||
97 | ok | ||
98 | ok | ||
99 | ok | ||
100 | ok | ||
101 | ok | ||
102 | ok | ||
103 | ok | ||
104 | ok | ||
105 | ok | ||
106 | ok | ||
107 | ok | ||
108 | ok | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test deleted file mode 100644 index a776d032..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "empty" test | ||
3 | --TEMPLATE-- | ||
4 | {{ foo is empty ? 'ok' : 'ko' }} | ||
5 | {{ bar is empty ? 'ok' : 'ko' }} | ||
6 | {{ foobar is empty ? 'ok' : 'ko' }} | ||
7 | {{ array is empty ? 'ok' : 'ko' }} | ||
8 | {{ zero is empty ? 'ok' : 'ko' }} | ||
9 | {{ string is empty ? 'ok' : 'ko' }} | ||
10 | {{ countable_empty is empty ? 'ok' : 'ko' }} | ||
11 | {{ countable_not_empty is empty ? 'ok' : 'ko' }} | ||
12 | {{ markup_empty is empty ? 'ok' : 'ko' }} | ||
13 | {{ markup_not_empty is empty ? 'ok' : 'ko' }} | ||
14 | --DATA-- | ||
15 | |||
16 | class CountableStub implements Countable | ||
17 | { | ||
18 | private $items; | ||
19 | |||
20 | public function __construct(array $items) | ||
21 | { | ||
22 | $this->items = $items; | ||
23 | } | ||
24 | |||
25 | public function count() | ||
26 | { | ||
27 | return count($this->items); | ||
28 | } | ||
29 | } | ||
30 | return array( | ||
31 | 'foo' => '', 'bar' => null, 'foobar' => false, 'array' => array(), 'zero' => 0, 'string' => '0', | ||
32 | 'countable_empty' => new CountableStub(array()), 'countable_not_empty' => new CountableStub(array(1, 2)), | ||
33 | 'markup_empty' => new Twig_Markup('', 'UTF-8'), 'markup_not_empty' => new Twig_Markup('test', 'UTF-8'), | ||
34 | ); | ||
35 | --EXPECT-- | ||
36 | ok | ||
37 | ok | ||
38 | ok | ||
39 | ok | ||
40 | ko | ||
41 | ko | ||
42 | ok | ||
43 | ko | ||
44 | ok | ||
45 | ko | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test deleted file mode 100644 index 695b4c2f..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "even" test | ||
3 | --TEMPLATE-- | ||
4 | {{ 1 is even ? 'ko' : 'ok' }} | ||
5 | {{ 2 is even ? 'ok' : 'ko' }} | ||
6 | {{ 1 is not even ? 'ok' : 'ko' }} | ||
7 | {{ 2 is not even ? 'ko' : 'ok' }} | ||
8 | --DATA-- | ||
9 | return array() | ||
10 | --EXPECT-- | ||
11 | ok | ||
12 | ok | ||
13 | ok | ||
14 | ok | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test deleted file mode 100644 index 45c72fd2..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports the in operator | ||
3 | --TEMPLATE-- | ||
4 | {% if bar in foo %} | ||
5 | TRUE | ||
6 | {% endif %} | ||
7 | {% if not (bar in foo) %} | ||
8 | {% else %} | ||
9 | TRUE | ||
10 | {% endif %} | ||
11 | {% if bar not in foo %} | ||
12 | {% else %} | ||
13 | TRUE | ||
14 | {% endif %} | ||
15 | {% if 'a' in bar %} | ||
16 | TRUE | ||
17 | {% endif %} | ||
18 | {% if 'c' not in bar %} | ||
19 | TRUE | ||
20 | {% endif %} | ||
21 | {% if '' not in bar %} | ||
22 | TRUE | ||
23 | {% endif %} | ||
24 | {% if '' in '' %} | ||
25 | TRUE | ||
26 | {% endif %} | ||
27 | {% if '0' not in '' %} | ||
28 | TRUE | ||
29 | {% endif %} | ||
30 | {% if 'a' not in '0' %} | ||
31 | TRUE | ||
32 | {% endif %} | ||
33 | {% if '0' in '0' %} | ||
34 | TRUE | ||
35 | {% endif %} | ||
36 | --DATA-- | ||
37 | return array('bar' => 'bar', 'foo' => array('bar' => 'bar')) | ||
38 | --EXPECT-- | ||
39 | TRUE | ||
40 | TRUE | ||
41 | TRUE | ||
42 | TRUE | ||
43 | TRUE | ||
44 | TRUE | ||
45 | TRUE | ||
46 | TRUE | ||
47 | TRUE | ||
48 | TRUE | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test deleted file mode 100644 index 8e08061b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | --TEST-- | ||
2 | Twig supports the in operator when using objects | ||
3 | --TEMPLATE-- | ||
4 | {% if object in object_list %} | ||
5 | TRUE | ||
6 | {% endif %} | ||
7 | --DATA-- | ||
8 | $foo = new TwigTestFoo(); | ||
9 | $foo1 = new TwigTestFoo(); | ||
10 | |||
11 | $foo->position = $foo1; | ||
12 | $foo1->position = $foo; | ||
13 | |||
14 | return array( | ||
15 | 'object' => $foo, | ||
16 | 'object_list' => array($foo1, $foo), | ||
17 | ); | ||
18 | --EXPECT-- | ||
19 | TRUE | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test deleted file mode 100644 index ec525501..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "iterable" test | ||
3 | --TEMPLATE-- | ||
4 | {{ foo is iterable ? 'ok' : 'ko' }} | ||
5 | {{ traversable is iterable ? 'ok' : 'ko' }} | ||
6 | {{ obj is iterable ? 'ok' : 'ko' }} | ||
7 | {{ val is iterable ? 'ok' : 'ko' }} | ||
8 | --DATA-- | ||
9 | return array( | ||
10 | 'foo' => array(), | ||
11 | 'traversable' => new ArrayIterator(array()), | ||
12 | 'obj' => new stdClass(), | ||
13 | 'val' => 'test', | ||
14 | ); | ||
15 | --EXPECT-- | ||
16 | ok | ||
17 | ok | ||
18 | ko | ||
19 | ko \ No newline at end of file | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test deleted file mode 100644 index 1b8311e3..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --TEST-- | ||
2 | "odd" test | ||
3 | --TEMPLATE-- | ||
4 | {{ 1 is odd ? 'ok' : 'ko' }} | ||
5 | {{ 2 is odd ? 'ko' : 'ok' }} | ||
6 | --DATA-- | ||
7 | return array() | ||
8 | --EXPECT-- | ||
9 | ok | ||
10 | ok \ No newline at end of file | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php b/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php deleted file mode 100644 index 5feb8f4e..00000000 --- a/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php +++ /dev/null | |||
@@ -1,217 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | // This function is defined to check that escaping strategies | ||
13 | // like html works even if a function with the same name is defined. | ||
14 | function html() | ||
15 | { | ||
16 | return 'foo'; | ||
17 | } | ||
18 | |||
19 | class Twig_Tests_IntegrationTest extends Twig_Test_IntegrationTestCase | ||
20 | { | ||
21 | public function getExtensions() | ||
22 | { | ||
23 | $policy = new Twig_Sandbox_SecurityPolicy(array(), array(), array(), array(), array()); | ||
24 | |||
25 | return array( | ||
26 | new Twig_Extension_Debug(), | ||
27 | new Twig_Extension_Sandbox($policy, false), | ||
28 | new Twig_Extension_StringLoader(), | ||
29 | new TwigTestExtension(), | ||
30 | ); | ||
31 | } | ||
32 | |||
33 | public function getFixturesDir() | ||
34 | { | ||
35 | return dirname(__FILE__).'/Fixtures/'; | ||
36 | } | ||
37 | } | ||
38 | |||
39 | function test_foo($value = 'foo') | ||
40 | { | ||
41 | return $value; | ||
42 | } | ||
43 | |||
44 | class TwigTestFoo implements Iterator | ||
45 | { | ||
46 | const BAR_NAME = 'bar'; | ||
47 | |||
48 | public $position = 0; | ||
49 | public $array = array(1, 2); | ||
50 | |||
51 | public function bar($param1 = null, $param2 = null) | ||
52 | { | ||
53 | return 'bar'.($param1 ? '_'.$param1 : '').($param2 ? '-'.$param2 : ''); | ||
54 | } | ||
55 | |||
56 | public function getFoo() | ||
57 | { | ||
58 | return 'foo'; | ||
59 | } | ||
60 | |||
61 | public function getSelf() | ||
62 | { | ||
63 | return $this; | ||
64 | } | ||
65 | |||
66 | public function is() | ||
67 | { | ||
68 | return 'is'; | ||
69 | } | ||
70 | |||
71 | public function in() | ||
72 | { | ||
73 | return 'in'; | ||
74 | } | ||
75 | |||
76 | public function not() | ||
77 | { | ||
78 | return 'not'; | ||
79 | } | ||
80 | |||
81 | public function strToLower($value) | ||
82 | { | ||
83 | return strtolower($value); | ||
84 | } | ||
85 | |||
86 | public function rewind() | ||
87 | { | ||
88 | $this->position = 0; | ||
89 | } | ||
90 | |||
91 | public function current() | ||
92 | { | ||
93 | return $this->array[$this->position]; | ||
94 | } | ||
95 | |||
96 | public function key() | ||
97 | { | ||
98 | return 'a'; | ||
99 | } | ||
100 | |||
101 | public function next() | ||
102 | { | ||
103 | ++$this->position; | ||
104 | } | ||
105 | |||
106 | public function valid() | ||
107 | { | ||
108 | return isset($this->array[$this->position]); | ||
109 | } | ||
110 | } | ||
111 | |||
112 | class TwigTestTokenParser_§ extends Twig_TokenParser | ||
113 | { | ||
114 | public function parse(Twig_Token $token) | ||
115 | { | ||
116 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); | ||
117 | |||
118 | return new Twig_Node_Print(new Twig_Node_Expression_Constant('§', -1), -1); | ||
119 | } | ||
120 | |||
121 | public function getTag() | ||
122 | { | ||
123 | return '§'; | ||
124 | } | ||
125 | } | ||
126 | |||
127 | class TwigTestExtension extends Twig_Extension | ||
128 | { | ||
129 | public function getTokenParsers() | ||
130 | { | ||
131 | return array( | ||
132 | new TwigTestTokenParser_§(), | ||
133 | ); | ||
134 | } | ||
135 | |||
136 | public function getFilters() | ||
137 | { | ||
138 | return array( | ||
139 | '§' => new Twig_Filter_Method($this, '§Filter'), | ||
140 | 'escape_and_nl2br' => new Twig_Filter_Method($this, 'escape_and_nl2br', array('needs_environment' => true, 'is_safe' => array('html'))), | ||
141 | 'nl2br' => new Twig_Filter_Method($this, 'nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))), | ||
142 | 'escape_something' => new Twig_Filter_Method($this, 'escape_something', array('is_safe' => array('something'))), | ||
143 | 'preserves_safety' => new Twig_Filter_Method($this, 'preserves_safety', array('preserves_safety' => array('html'))), | ||
144 | '*_path' => new Twig_Filter_Method($this, 'dynamic_path'), | ||
145 | '*_foo_*_bar' => new Twig_Filter_Method($this, 'dynamic_foo'), | ||
146 | ); | ||
147 | } | ||
148 | |||
149 | public function getFunctions() | ||
150 | { | ||
151 | return array( | ||
152 | '§' => new Twig_Function_Method($this, '§Function'), | ||
153 | 'safe_br' => new Twig_Function_Method($this, 'br', array('is_safe' => array('html'))), | ||
154 | 'unsafe_br' => new Twig_Function_Method($this, 'br'), | ||
155 | '*_path' => new Twig_Function_Method($this, 'dynamic_path'), | ||
156 | '*_foo_*_bar' => new Twig_Function_Method($this, 'dynamic_foo'), | ||
157 | ); | ||
158 | } | ||
159 | |||
160 | public function §Filter($value) | ||
161 | { | ||
162 | return "§{$value}§"; | ||
163 | } | ||
164 | |||
165 | public function §Function($value) | ||
166 | { | ||
167 | return "§{$value}§"; | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * nl2br which also escapes, for testing escaper filters | ||
172 | */ | ||
173 | public function escape_and_nl2br($env, $value, $sep = '<br />') | ||
174 | { | ||
175 | return $this->nl2br(twig_escape_filter($env, $value, 'html'), $sep); | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * nl2br only, for testing filters with pre_escape | ||
180 | */ | ||
181 | public function nl2br($value, $sep = '<br />') | ||
182 | { | ||
183 | // not secure if $value contains html tags (not only entities) | ||
184 | // don't use | ||
185 | return str_replace("\n", "$sep\n", $value); | ||
186 | } | ||
187 | |||
188 | public function dynamic_path($element, $item) | ||
189 | { | ||
190 | return $element.'/'.$item; | ||
191 | } | ||
192 | |||
193 | public function dynamic_foo($foo, $bar, $item) | ||
194 | { | ||
195 | return $foo.'/'.$bar.'/'.$item; | ||
196 | } | ||
197 | |||
198 | public function escape_something($value) | ||
199 | { | ||
200 | return strtoupper($value); | ||
201 | } | ||
202 | |||
203 | public function preserves_safety($value) | ||
204 | { | ||
205 | return strtoupper($value); | ||
206 | } | ||
207 | |||
208 | public function br() | ||
209 | { | ||
210 | return '<br />'; | ||
211 | } | ||
212 | |||
213 | public function getName() | ||
214 | { | ||
215 | return 'integration_test'; | ||
216 | } | ||
217 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/LexerTest.php b/vendor/twig/twig/test/Twig/Tests/LexerTest.php deleted file mode 100644 index 9f3c7510..00000000 --- a/vendor/twig/twig/test/Twig/Tests/LexerTest.php +++ /dev/null | |||
@@ -1,301 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase | ||
12 | { | ||
13 | public function testNameLabelForTag() | ||
14 | { | ||
15 | $template = '{% § %}'; | ||
16 | |||
17 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
18 | $stream = $lexer->tokenize($template); | ||
19 | |||
20 | $stream->expect(Twig_Token::BLOCK_START_TYPE); | ||
21 | $this->assertSame('§', $stream->expect(Twig_Token::NAME_TYPE)->getValue()); | ||
22 | } | ||
23 | |||
24 | public function testNameLabelForFunction() | ||
25 | { | ||
26 | $template = '{{ §() }}'; | ||
27 | |||
28 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
29 | $stream = $lexer->tokenize($template); | ||
30 | |||
31 | $stream->expect(Twig_Token::VAR_START_TYPE); | ||
32 | $this->assertSame('§', $stream->expect(Twig_Token::NAME_TYPE)->getValue()); | ||
33 | } | ||
34 | |||
35 | public function testBracketsNesting() | ||
36 | { | ||
37 | $template = '{{ {"a":{"b":"c"}} }}'; | ||
38 | |||
39 | $this->assertEquals(2, $this->countToken($template, Twig_Token::PUNCTUATION_TYPE, '{')); | ||
40 | $this->assertEquals(2, $this->countToken($template, Twig_Token::PUNCTUATION_TYPE, '}')); | ||
41 | } | ||
42 | |||
43 | protected function countToken($template, $type, $value = null) | ||
44 | { | ||
45 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
46 | $stream = $lexer->tokenize($template); | ||
47 | |||
48 | $count = 0; | ||
49 | $tokens = array(); | ||
50 | while (!$stream->isEOF()) { | ||
51 | $token = $stream->next(); | ||
52 | if ($type === $token->getType()) { | ||
53 | if (null === $value || $value === $token->getValue()) { | ||
54 | ++$count; | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | |||
59 | return $count; | ||
60 | } | ||
61 | |||
62 | public function testLineDirective() | ||
63 | { | ||
64 | $template = "foo\n" | ||
65 | . "bar\n" | ||
66 | . "{% line 10 %}\n" | ||
67 | . "{{\n" | ||
68 | . "baz\n" | ||
69 | . "}}\n"; | ||
70 | |||
71 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
72 | $stream = $lexer->tokenize($template); | ||
73 | |||
74 | // foo\nbar\n | ||
75 | $this->assertSame(1, $stream->expect(Twig_Token::TEXT_TYPE)->getLine()); | ||
76 | // \n (after {% line %}) | ||
77 | $this->assertSame(10, $stream->expect(Twig_Token::TEXT_TYPE)->getLine()); | ||
78 | // {{ | ||
79 | $this->assertSame(11, $stream->expect(Twig_Token::VAR_START_TYPE)->getLine()); | ||
80 | // baz | ||
81 | $this->assertSame(12, $stream->expect(Twig_Token::NAME_TYPE)->getLine()); | ||
82 | } | ||
83 | |||
84 | public function testLineDirectiveInline() | ||
85 | { | ||
86 | $template = "foo\n" | ||
87 | . "bar{% line 10 %}{{\n" | ||
88 | . "baz\n" | ||
89 | . "}}\n"; | ||
90 | |||
91 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
92 | $stream = $lexer->tokenize($template); | ||
93 | |||
94 | // foo\nbar | ||
95 | $this->assertSame(1, $stream->expect(Twig_Token::TEXT_TYPE)->getLine()); | ||
96 | // {{ | ||
97 | $this->assertSame(10, $stream->expect(Twig_Token::VAR_START_TYPE)->getLine()); | ||
98 | // baz | ||
99 | $this->assertSame(11, $stream->expect(Twig_Token::NAME_TYPE)->getLine()); | ||
100 | } | ||
101 | |||
102 | public function testLongComments() | ||
103 | { | ||
104 | $template = '{# '.str_repeat('*', 100000).' #}'; | ||
105 | |||
106 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
107 | $lexer->tokenize($template); | ||
108 | |||
109 | // should not throw an exception | ||
110 | } | ||
111 | |||
112 | public function testLongRaw() | ||
113 | { | ||
114 | $template = '{% raw %}'.str_repeat('*', 100000).'{% endraw %}'; | ||
115 | |||
116 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
117 | $stream = $lexer->tokenize($template); | ||
118 | |||
119 | // should not throw an exception | ||
120 | } | ||
121 | |||
122 | public function testLongVar() | ||
123 | { | ||
124 | $template = '{{ '.str_repeat('x', 100000).' }}'; | ||
125 | |||
126 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
127 | $stream = $lexer->tokenize($template); | ||
128 | |||
129 | // should not throw an exception | ||
130 | } | ||
131 | |||
132 | public function testLongBlock() | ||
133 | { | ||
134 | $template = '{% '.str_repeat('x', 100000).' %}'; | ||
135 | |||
136 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
137 | $stream = $lexer->tokenize($template); | ||
138 | |||
139 | // should not throw an exception | ||
140 | } | ||
141 | |||
142 | public function testBigNumbers() | ||
143 | { | ||
144 | $template = '{{ 922337203685477580700 }}'; | ||
145 | |||
146 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
147 | $stream = $lexer->tokenize($template); | ||
148 | $node = $stream->next(); | ||
149 | $node = $stream->next(); | ||
150 | $this->assertEquals(922337203685477580700, $node->getValue()); | ||
151 | } | ||
152 | |||
153 | public function testStringWithEscapedDelimiter() | ||
154 | { | ||
155 | $tests = array( | ||
156 | "{{ 'foo \' bar' }}" => 'foo \' bar', | ||
157 | '{{ "foo \" bar" }}' => "foo \" bar", | ||
158 | ); | ||
159 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
160 | foreach ($tests as $template => $expected) { | ||
161 | $stream = $lexer->tokenize($template); | ||
162 | $stream->expect(Twig_Token::VAR_START_TYPE); | ||
163 | $stream->expect(Twig_Token::STRING_TYPE, $expected); | ||
164 | } | ||
165 | } | ||
166 | |||
167 | public function testStringWithInterpolation() | ||
168 | { | ||
169 | $template = 'foo {{ "bar #{ baz + 1 }" }}'; | ||
170 | |||
171 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
172 | $stream = $lexer->tokenize($template); | ||
173 | $stream->expect(Twig_Token::TEXT_TYPE, 'foo '); | ||
174 | $stream->expect(Twig_Token::VAR_START_TYPE); | ||
175 | $stream->expect(Twig_Token::STRING_TYPE, 'bar '); | ||
176 | $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); | ||
177 | $stream->expect(Twig_Token::NAME_TYPE, 'baz'); | ||
178 | $stream->expect(Twig_Token::OPERATOR_TYPE, '+'); | ||
179 | $stream->expect(Twig_Token::NUMBER_TYPE, '1'); | ||
180 | $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); | ||
181 | $stream->expect(Twig_Token::VAR_END_TYPE); | ||
182 | } | ||
183 | |||
184 | public function testStringWithEscapedInterpolation() | ||
185 | { | ||
186 | $template = '{{ "bar \#{baz+1}" }}'; | ||
187 | |||
188 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
189 | $stream = $lexer->tokenize($template); | ||
190 | $stream->expect(Twig_Token::VAR_START_TYPE); | ||
191 | $stream->expect(Twig_Token::STRING_TYPE, 'bar #{baz+1}'); | ||
192 | $stream->expect(Twig_Token::VAR_END_TYPE); | ||
193 | } | ||
194 | |||
195 | public function testStringWithHash() | ||
196 | { | ||
197 | $template = '{{ "bar # baz" }}'; | ||
198 | |||
199 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
200 | $stream = $lexer->tokenize($template); | ||
201 | $stream->expect(Twig_Token::VAR_START_TYPE); | ||
202 | $stream->expect(Twig_Token::STRING_TYPE, 'bar # baz'); | ||
203 | $stream->expect(Twig_Token::VAR_END_TYPE); | ||
204 | } | ||
205 | |||
206 | /** | ||
207 | * @expectedException Twig_Error_Syntax | ||
208 | * @expectedExceptionMessage Unclosed """ | ||
209 | */ | ||
210 | public function testStringWithUnterminatedInterpolation() | ||
211 | { | ||
212 | $template = '{{ "bar #{x" }}'; | ||
213 | |||
214 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
215 | $stream = $lexer->tokenize($template); | ||
216 | } | ||
217 | |||
218 | public function testStringWithNestedInterpolations() | ||
219 | { | ||
220 | $template = '{{ "bar #{ "foo#{bar}" }" }}'; | ||
221 | |||
222 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
223 | $stream = $lexer->tokenize($template); | ||
224 | $stream->expect(Twig_Token::VAR_START_TYPE); | ||
225 | $stream->expect(Twig_Token::STRING_TYPE, 'bar '); | ||
226 | $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); | ||
227 | $stream->expect(Twig_Token::STRING_TYPE, 'foo'); | ||
228 | $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); | ||
229 | $stream->expect(Twig_Token::NAME_TYPE, 'bar'); | ||
230 | $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); | ||
231 | $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); | ||
232 | $stream->expect(Twig_Token::VAR_END_TYPE); | ||
233 | } | ||
234 | |||
235 | public function testStringWithNestedInterpolationsInBlock() | ||
236 | { | ||
237 | $template = '{% foo "bar #{ "foo#{bar}" }" %}'; | ||
238 | |||
239 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
240 | $stream = $lexer->tokenize($template); | ||
241 | $stream->expect(Twig_Token::BLOCK_START_TYPE); | ||
242 | $stream->expect(Twig_Token::NAME_TYPE, 'foo'); | ||
243 | $stream->expect(Twig_Token::STRING_TYPE, 'bar '); | ||
244 | $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); | ||
245 | $stream->expect(Twig_Token::STRING_TYPE, 'foo'); | ||
246 | $stream->expect(Twig_Token::INTERPOLATION_START_TYPE); | ||
247 | $stream->expect(Twig_Token::NAME_TYPE, 'bar'); | ||
248 | $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); | ||
249 | $stream->expect(Twig_Token::INTERPOLATION_END_TYPE); | ||
250 | $stream->expect(Twig_Token::BLOCK_END_TYPE); | ||
251 | } | ||
252 | |||
253 | public function testOperatorEndingWithALetterAtTheEndOfALine() | ||
254 | { | ||
255 | $template = "{{ 1 and\n0}}"; | ||
256 | |||
257 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
258 | $stream = $lexer->tokenize($template); | ||
259 | $stream->expect(Twig_Token::VAR_START_TYPE); | ||
260 | $stream->expect(Twig_Token::NUMBER_TYPE, 1); | ||
261 | $stream->expect(Twig_Token::OPERATOR_TYPE, 'and'); | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * @expectedException Twig_Error_Syntax | ||
266 | * @expectedExceptionMessage Unclosed "variable" at line 3 | ||
267 | */ | ||
268 | public function testUnterminatedVariable() | ||
269 | { | ||
270 | $template = ' | ||
271 | |||
272 | {{ | ||
273 | |||
274 | bar | ||
275 | |||
276 | |||
277 | '; | ||
278 | |||
279 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
280 | $stream = $lexer->tokenize($template); | ||
281 | } | ||
282 | |||
283 | /** | ||
284 | * @expectedException Twig_Error_Syntax | ||
285 | * @expectedExceptionMessage Unclosed "block" at line 3 | ||
286 | */ | ||
287 | public function testUnterminatedBlock() | ||
288 | { | ||
289 | $template = ' | ||
290 | |||
291 | {% | ||
292 | |||
293 | bar | ||
294 | |||
295 | |||
296 | '; | ||
297 | |||
298 | $lexer = new Twig_Lexer(new Twig_Environment()); | ||
299 | $stream = $lexer->tokenize($template); | ||
300 | } | ||
301 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php deleted file mode 100644 index 1369a6bd..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Loader_ArrayTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | public function testGetSource() | ||
15 | { | ||
16 | $loader = new Twig_Loader_Array(array('foo' => 'bar')); | ||
17 | |||
18 | $this->assertEquals('bar', $loader->getSource('foo')); | ||
19 | } | ||
20 | |||
21 | /** | ||
22 | * @expectedException Twig_Error_Loader | ||
23 | */ | ||
24 | public function testGetSourceWhenTemplateDoesNotExist() | ||
25 | { | ||
26 | $loader = new Twig_Loader_Array(array()); | ||
27 | |||
28 | $loader->getSource('foo'); | ||
29 | } | ||
30 | |||
31 | public function testGetCacheKey() | ||
32 | { | ||
33 | $loader = new Twig_Loader_Array(array('foo' => 'bar')); | ||
34 | |||
35 | $this->assertEquals('bar', $loader->getCacheKey('foo')); | ||
36 | } | ||
37 | |||
38 | /** | ||
39 | * @expectedException Twig_Error_Loader | ||
40 | */ | ||
41 | public function testGetCacheKeyWhenTemplateDoesNotExist() | ||
42 | { | ||
43 | $loader = new Twig_Loader_Array(array()); | ||
44 | |||
45 | $loader->getCacheKey('foo'); | ||
46 | } | ||
47 | |||
48 | public function testSetTemplate() | ||
49 | { | ||
50 | $loader = new Twig_Loader_Array(array()); | ||
51 | $loader->setTemplate('foo', 'bar'); | ||
52 | |||
53 | $this->assertEquals('bar', $loader->getSource('foo')); | ||
54 | } | ||
55 | |||
56 | public function testIsFresh() | ||
57 | { | ||
58 | $loader = new Twig_Loader_Array(array('foo' => 'bar')); | ||
59 | $this->assertTrue($loader->isFresh('foo', time())); | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * @expectedException Twig_Error_Loader | ||
64 | */ | ||
65 | public function testIsFreshWhenTemplateDoesNotExist() | ||
66 | { | ||
67 | $loader = new Twig_Loader_Array(array()); | ||
68 | |||
69 | $loader->isFresh('foo', time()); | ||
70 | } | ||
71 | |||
72 | public function testTemplateReference() | ||
73 | { | ||
74 | $name = new Twig_Test_Loader_TemplateReference('foo'); | ||
75 | $loader = new Twig_Loader_Array(array('foo' => 'bar')); | ||
76 | |||
77 | $loader->getCacheKey($name); | ||
78 | $loader->getSource($name); | ||
79 | $loader->isFresh($name, time()); | ||
80 | $loader->setTemplate($name, 'foobar'); | ||
81 | } | ||
82 | } | ||
83 | |||
84 | class Twig_Test_Loader_TemplateReference | ||
85 | { | ||
86 | private $name; | ||
87 | |||
88 | public function __construct($name) | ||
89 | { | ||
90 | $this->name = $name; | ||
91 | } | ||
92 | |||
93 | public function __toString() | ||
94 | { | ||
95 | return $this->name; | ||
96 | } | ||
97 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php deleted file mode 100644 index 4fe0db94..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Loader_ChainTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | public function testGetSource() | ||
15 | { | ||
16 | $loader = new Twig_Loader_Chain(array( | ||
17 | new Twig_Loader_Array(array('foo' => 'bar')), | ||
18 | new Twig_Loader_Array(array('foo' => 'foobar', 'bar' => 'foo')), | ||
19 | )); | ||
20 | |||
21 | $this->assertEquals('bar', $loader->getSource('foo')); | ||
22 | $this->assertEquals('foo', $loader->getSource('bar')); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @expectedException Twig_Error_Loader | ||
27 | */ | ||
28 | public function testGetSourceWhenTemplateDoesNotExist() | ||
29 | { | ||
30 | $loader = new Twig_Loader_Chain(array()); | ||
31 | |||
32 | $loader->getSource('foo'); | ||
33 | } | ||
34 | |||
35 | public function testGetCacheKey() | ||
36 | { | ||
37 | $loader = new Twig_Loader_Chain(array( | ||
38 | new Twig_Loader_Array(array('foo' => 'bar')), | ||
39 | new Twig_Loader_Array(array('foo' => 'foobar', 'bar' => 'foo')), | ||
40 | )); | ||
41 | |||
42 | $this->assertEquals('bar', $loader->getCacheKey('foo')); | ||
43 | $this->assertEquals('foo', $loader->getCacheKey('bar')); | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * @expectedException Twig_Error_Loader | ||
48 | */ | ||
49 | public function testGetCacheKeyWhenTemplateDoesNotExist() | ||
50 | { | ||
51 | $loader = new Twig_Loader_Chain(array()); | ||
52 | |||
53 | $loader->getCacheKey('foo'); | ||
54 | } | ||
55 | |||
56 | public function testAddLoader() | ||
57 | { | ||
58 | $loader = new Twig_Loader_Chain(); | ||
59 | $loader->addLoader(new Twig_Loader_Array(array('foo' => 'bar'))); | ||
60 | |||
61 | $this->assertEquals('bar', $loader->getSource('foo')); | ||
62 | } | ||
63 | |||
64 | public function testExists() | ||
65 | { | ||
66 | $loader1 = $this->getMock('Twig_Loader_Array', array('exists', 'getSource'), array(), '', false); | ||
67 | $loader1->expects($this->once())->method('exists')->will($this->returnValue(false)); | ||
68 | $loader1->expects($this->never())->method('getSource'); | ||
69 | |||
70 | $loader2 = $this->getMock('Twig_LoaderInterface'); | ||
71 | $loader2->expects($this->once())->method('getSource')->will($this->returnValue('content')); | ||
72 | |||
73 | $loader = new Twig_Loader_Chain(); | ||
74 | $loader->addLoader($loader1); | ||
75 | $loader->addLoader($loader2); | ||
76 | |||
77 | $this->assertTrue($loader->exists('foo')); | ||
78 | } | ||
79 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php deleted file mode 100644 index 4c874b6b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Loader_FilesystemTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | /** | ||
15 | * @dataProvider getSecurityTests | ||
16 | */ | ||
17 | public function testSecurity($template) | ||
18 | { | ||
19 | $loader = new Twig_Loader_Filesystem(array(dirname(__FILE__).'/../Fixtures')); | ||
20 | |||
21 | try { | ||
22 | $loader->getCacheKey($template); | ||
23 | $this->fail(); | ||
24 | } catch (Twig_Error_Loader $e) { | ||
25 | $this->assertNotContains('Unable to find template', $e->getMessage()); | ||
26 | } | ||
27 | } | ||
28 | |||
29 | public function getSecurityTests() | ||
30 | { | ||
31 | return array( | ||
32 | array("AutoloaderTest\0.php"), | ||
33 | array('..\\AutoloaderTest.php'), | ||
34 | array('..\\\\\\AutoloaderTest.php'), | ||
35 | array('../AutoloaderTest.php'), | ||
36 | array('..////AutoloaderTest.php'), | ||
37 | array('./../AutoloaderTest.php'), | ||
38 | array('.\\..\\AutoloaderTest.php'), | ||
39 | array('././././././../AutoloaderTest.php'), | ||
40 | array('.\\./.\\./.\\./../AutoloaderTest.php'), | ||
41 | array('foo/../../AutoloaderTest.php'), | ||
42 | array('foo\\..\\..\\AutoloaderTest.php'), | ||
43 | array('foo/../bar/../../AutoloaderTest.php'), | ||
44 | array('foo/bar/../../../AutoloaderTest.php'), | ||
45 | array('filters/../../AutoloaderTest.php'), | ||
46 | array('filters//..//..//AutoloaderTest.php'), | ||
47 | array('filters\\..\\..\\AutoloaderTest.php'), | ||
48 | array('filters\\\\..\\\\..\\\\AutoloaderTest.php'), | ||
49 | array('filters\\//../\\/\\..\\AutoloaderTest.php'), | ||
50 | array('/../AutoloaderTest.php'), | ||
51 | ); | ||
52 | } | ||
53 | |||
54 | public function testPaths() | ||
55 | { | ||
56 | $basePath = dirname(__FILE__).'/Fixtures'; | ||
57 | |||
58 | $loader = new Twig_Loader_Filesystem(array($basePath.'/normal', $basePath.'/normal_bis')); | ||
59 | $loader->setPaths(array($basePath.'/named', $basePath.'/named_bis'), 'named'); | ||
60 | $loader->addPath($basePath.'/named_ter', 'named'); | ||
61 | $loader->addPath($basePath.'/normal_ter'); | ||
62 | $loader->prependPath($basePath.'/normal_final'); | ||
63 | $loader->prependPath($basePath.'/named_final', 'named'); | ||
64 | |||
65 | $this->assertEquals(array( | ||
66 | $basePath.'/normal_final', | ||
67 | $basePath.'/normal', | ||
68 | $basePath.'/normal_bis', | ||
69 | $basePath.'/normal_ter', | ||
70 | ), $loader->getPaths()); | ||
71 | $this->assertEquals(array( | ||
72 | $basePath.'/named_final', | ||
73 | $basePath.'/named', | ||
74 | $basePath.'/named_bis', | ||
75 | $basePath.'/named_ter', | ||
76 | ), $loader->getPaths('named')); | ||
77 | |||
78 | $this->assertEquals("path (final)\n", $loader->getSource('index.html')); | ||
79 | $this->assertEquals("path (final)\n", $loader->getSource('@__main__/index.html')); | ||
80 | $this->assertEquals("named path (final)\n", $loader->getSource('@named/index.html')); | ||
81 | } | ||
82 | |||
83 | public function testEmptyConstructor() | ||
84 | { | ||
85 | $loader = new Twig_Loader_Filesystem(); | ||
86 | $this->assertEquals(array(), $loader->getPaths()); | ||
87 | } | ||
88 | |||
89 | public function testGetNamespaces() | ||
90 | { | ||
91 | $loader = new Twig_Loader_Filesystem(sys_get_temp_dir()); | ||
92 | $this->assertEquals(array(Twig_Loader_Filesystem::MAIN_NAMESPACE), $loader->getNamespaces()); | ||
93 | |||
94 | $loader->addPath(sys_get_temp_dir(), 'named'); | ||
95 | $this->assertEquals(array(Twig_Loader_Filesystem::MAIN_NAMESPACE, 'named'), $loader->getNamespaces()); | ||
96 | } | ||
97 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html deleted file mode 100644 index 9e5449c7..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | named path | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html deleted file mode 100644 index d3a272b1..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | named path (bis) | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html deleted file mode 100644 index 9f05d150..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | named path (final) | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html deleted file mode 100644 index 24fb68ad..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | named path (ter) | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html deleted file mode 100644 index e7a8fd4d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | path | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html deleted file mode 100644 index bfa91604..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | path (bis) | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html deleted file mode 100644 index 73a089bb..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | path (final) | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html deleted file mode 100644 index b7ad97d8..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | path (ter) | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php b/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php deleted file mode 100644 index 3fafd335..00000000 --- a/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_NativeExtensionTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | public function testGetProperties() | ||
15 | { | ||
16 | $twig = new Twig_Environment(new Twig_Loader_String(), array( | ||
17 | 'debug' => true, | ||
18 | 'cache' => false, | ||
19 | 'autoescape' => false | ||
20 | )); | ||
21 | |||
22 | $d1 = new DateTime(); | ||
23 | $d2 = new DateTime(); | ||
24 | $output = $twig->render('{{ d1.date }}{{ d2.date }}', compact('d1', 'd2')); | ||
25 | |||
26 | // If it fails, PHP will crash. | ||
27 | $this->assertEquals($output, $d1->date . $d2->date); | ||
28 | } | ||
29 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php b/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php deleted file mode 100644 index 608446bc..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_AutoEscapeTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_AutoEscape::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $body = new Twig_Node(array(new Twig_Node_Text('foo', 1))); | ||
20 | $node = new Twig_Node_AutoEscape(true, $body, 1); | ||
21 | |||
22 | $this->assertEquals($body, $node->getNode('body')); | ||
23 | $this->assertEquals(true, $node->getAttribute('value')); | ||
24 | } | ||
25 | |||
26 | /** | ||
27 | * @covers Twig_Node_AutoEscape::compile | ||
28 | * @dataProvider getTests | ||
29 | */ | ||
30 | public function testCompile($node, $source, $environment = null) | ||
31 | { | ||
32 | parent::testCompile($node, $source, $environment); | ||
33 | } | ||
34 | |||
35 | public function getTests() | ||
36 | { | ||
37 | $body = new Twig_Node(array(new Twig_Node_Text('foo', 1))); | ||
38 | $node = new Twig_Node_AutoEscape(true, $body, 1); | ||
39 | |||
40 | return array( | ||
41 | array($node, "// line 1\necho \"foo\";"), | ||
42 | ); | ||
43 | } | ||
44 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php b/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php deleted file mode 100644 index 96d0e101..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_BlockReferenceTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_BlockReference::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $node = new Twig_Node_BlockReference('foo', 1); | ||
20 | |||
21 | $this->assertEquals('foo', $node->getAttribute('name')); | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * @covers Twig_Node_BlockReference::compile | ||
26 | * @dataProvider getTests | ||
27 | */ | ||
28 | public function testCompile($node, $source, $environment = null) | ||
29 | { | ||
30 | parent::testCompile($node, $source, $environment); | ||
31 | } | ||
32 | |||
33 | public function getTests() | ||
34 | { | ||
35 | return array( | ||
36 | array(new Twig_Node_BlockReference('foo', 1), <<<EOF | ||
37 | // line 1 | ||
38 | \$this->displayBlock('foo', \$context, \$blocks); | ||
39 | EOF | ||
40 | ), | ||
41 | ); | ||
42 | } | ||
43 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php b/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php deleted file mode 100644 index 024049de..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_BlockTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Block::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $body = new Twig_Node_Text('foo', 1); | ||
20 | $node = new Twig_Node_Block('foo', $body, 1); | ||
21 | |||
22 | $this->assertEquals($body, $node->getNode('body')); | ||
23 | $this->assertEquals('foo', $node->getAttribute('name')); | ||
24 | } | ||
25 | |||
26 | /** | ||
27 | * @covers Twig_Node_Block::compile | ||
28 | * @dataProvider getTests | ||
29 | */ | ||
30 | public function testCompile($node, $source, $environment = null) | ||
31 | { | ||
32 | parent::testCompile($node, $source, $environment); | ||
33 | } | ||
34 | |||
35 | public function getTests() | ||
36 | { | ||
37 | $body = new Twig_Node_Text('foo', 1); | ||
38 | $node = new Twig_Node_Block('foo', $body, 1); | ||
39 | |||
40 | return array( | ||
41 | array($node, <<<EOF | ||
42 | // line 1 | ||
43 | public function block_foo(\$context, array \$blocks = array()) | ||
44 | { | ||
45 | echo "foo"; | ||
46 | } | ||
47 | EOF | ||
48 | ), | ||
49 | ); | ||
50 | } | ||
51 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php b/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php deleted file mode 100644 index a406e22d..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_DoTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Do::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr = new Twig_Node_Expression_Constant('foo', 1); | ||
20 | $node = new Twig_Node_Do($expr, 1); | ||
21 | |||
22 | $this->assertEquals($expr, $node->getNode('expr')); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @covers Twig_Node_Do::compile | ||
27 | * @dataProvider getTests | ||
28 | */ | ||
29 | public function testCompile($node, $source, $environment = null) | ||
30 | { | ||
31 | parent::testCompile($node, $source, $environment); | ||
32 | } | ||
33 | |||
34 | public function getTests() | ||
35 | { | ||
36 | $tests = array(); | ||
37 | |||
38 | $expr = new Twig_Node_Expression_Constant('foo', 1); | ||
39 | $node = new Twig_Node_Do($expr, 1); | ||
40 | $tests[] = array($node, "// line 1\n\"foo\";"); | ||
41 | |||
42 | return $tests; | ||
43 | } | ||
44 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php deleted file mode 100644 index c6a9044b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_ArrayTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Array::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $elements = array(new Twig_Node_Expression_Constant('foo', 1), $foo = new Twig_Node_Expression_Constant('bar', 1)); | ||
20 | $node = new Twig_Node_Expression_Array($elements, 1); | ||
21 | |||
22 | $this->assertEquals($foo, $node->getNode(1)); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @covers Twig_Node_Expression_Array::compile | ||
27 | * @dataProvider getTests | ||
28 | */ | ||
29 | public function testCompile($node, $source, $environment = null) | ||
30 | { | ||
31 | parent::testCompile($node, $source, $environment); | ||
32 | } | ||
33 | |||
34 | public function getTests() | ||
35 | { | ||
36 | $elements = array( | ||
37 | new Twig_Node_Expression_Constant('foo', 1), | ||
38 | new Twig_Node_Expression_Constant('bar', 1), | ||
39 | |||
40 | new Twig_Node_Expression_Constant('bar', 1), | ||
41 | new Twig_Node_Expression_Constant('foo', 1), | ||
42 | ); | ||
43 | $node = new Twig_Node_Expression_Array($elements, 1); | ||
44 | |||
45 | return array( | ||
46 | array($node, 'array("foo" => "bar", "bar" => "foo")'), | ||
47 | ); | ||
48 | } | ||
49 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php deleted file mode 100644 index b156dcc0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_AssignNameTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_AssignName::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $node = new Twig_Node_Expression_AssignName('foo', 1); | ||
20 | |||
21 | $this->assertEquals('foo', $node->getAttribute('name')); | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * @covers Twig_Node_Expression_AssignName::compile | ||
26 | * @dataProvider getTests | ||
27 | */ | ||
28 | public function testCompile($node, $source, $environment = null) | ||
29 | { | ||
30 | parent::testCompile($node, $source, $environment); | ||
31 | } | ||
32 | |||
33 | public function getTests() | ||
34 | { | ||
35 | $node = new Twig_Node_Expression_AssignName('foo', 1); | ||
36 | |||
37 | return array( | ||
38 | array($node, '$context["foo"]'), | ||
39 | ); | ||
40 | } | ||
41 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php deleted file mode 100644 index a0f49cb3..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Binary_AddTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_Add::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $node = new Twig_Node_Expression_Binary_Add($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_Add::compile | ||
29 | * @covers Twig_Node_Expression_Binary_Add::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
40 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
41 | $node = new Twig_Node_Expression_Binary_Add($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 + 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php deleted file mode 100644 index 50e551a7..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Binary_AndTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_And::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $node = new Twig_Node_Expression_Binary_And($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_And::compile | ||
29 | * @covers Twig_Node_Expression_Binary_And::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
40 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
41 | $node = new Twig_Node_Expression_Binary_And($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 && 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php deleted file mode 100644 index 140329fa..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Binary_ConcatTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_Concat::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $node = new Twig_Node_Expression_Binary_Concat($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_Concat::compile | ||
29 | * @covers Twig_Node_Expression_Binary_Concat::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
40 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
41 | $node = new Twig_Node_Expression_Binary_Concat($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 . 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php deleted file mode 100644 index 0c1a3c7f..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Binary_DivTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_Div::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $node = new Twig_Node_Expression_Binary_Div($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_Div::compile | ||
29 | * @covers Twig_Node_Expression_Binary_Div::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
40 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
41 | $node = new Twig_Node_Expression_Binary_Div($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 / 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php deleted file mode 100644 index ead1fde8..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Binary_FloorDivTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_FloorDiv::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $node = new Twig_Node_Expression_Binary_FloorDiv($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_FloorDiv::compile | ||
29 | * @covers Twig_Node_Expression_Binary_FloorDiv::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
40 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
41 | $node = new Twig_Node_Expression_Binary_FloorDiv($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, 'intval(floor((1 / 2)))'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php deleted file mode 100644 index 4fe1a1fc..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Binary_ModTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_Mod::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $node = new Twig_Node_Expression_Binary_Mod($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_Mod::compile | ||
29 | * @covers Twig_Node_Expression_Binary_Mod::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
40 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
41 | $node = new Twig_Node_Expression_Binary_Mod($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 % 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php deleted file mode 100644 index 12bb35c9..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Binary_MulTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_Mul::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $node = new Twig_Node_Expression_Binary_Mul($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_Mul::compile | ||
29 | * @covers Twig_Node_Expression_Binary_Mul::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
40 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
41 | $node = new Twig_Node_Expression_Binary_Mul($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 * 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php deleted file mode 100644 index 9534c41c..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Binary_OrTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_Or::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $node = new Twig_Node_Expression_Binary_Or($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_Or::compile | ||
29 | * @covers Twig_Node_Expression_Binary_Or::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
40 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
41 | $node = new Twig_Node_Expression_Binary_Or($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 || 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php deleted file mode 100644 index 9074893b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Binary_SubTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Binary_Sub::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $node = new Twig_Node_Expression_Binary_Sub($left, $right, 1); | ||
22 | |||
23 | $this->assertEquals($left, $node->getNode('left')); | ||
24 | $this->assertEquals($right, $node->getNode('right')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Binary_Sub::compile | ||
29 | * @covers Twig_Node_Expression_Binary_Sub::operator | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $left = new Twig_Node_Expression_Constant(1, 1); | ||
40 | $right = new Twig_Node_Expression_Constant(2, 1); | ||
41 | $node = new Twig_Node_Expression_Binary_Sub($left, $right, 1); | ||
42 | |||
43 | return array( | ||
44 | array($node, '(1 - 2)'), | ||
45 | ); | ||
46 | } | ||
47 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php deleted file mode 100644 index 53b5e6ee..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_CallTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | public function testGetArguments() | ||
15 | { | ||
16 | $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); | ||
17 | $this->assertEquals(array('U'), $node->getArguments('date', array('format' => 'U'))); | ||
18 | } | ||
19 | |||
20 | /** | ||
21 | * @expectedException Twig_Error_Syntax | ||
22 | * @expectedExceptionMessage Positional arguments cannot be used after named arguments for function "date". | ||
23 | */ | ||
24 | public function testGetArgumentsWhenPositionalArgumentsAfterNamedArguments() | ||
25 | { | ||
26 | $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); | ||
27 | $node->getArguments('date', array('timestamp' => 123456, 'Y-m-d')); | ||
28 | } | ||
29 | |||
30 | /** | ||
31 | * @expectedException Twig_Error_Syntax | ||
32 | * @expectedExceptionMessage Argument "format" is defined twice for function "date". | ||
33 | */ | ||
34 | public function testGetArgumentsWhenArgumentIsDefinedTwice() | ||
35 | { | ||
36 | $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); | ||
37 | $node->getArguments('date', array('Y-m-d', 'format' => 'U')); | ||
38 | } | ||
39 | |||
40 | /** | ||
41 | * @expectedException Twig_Error_Syntax | ||
42 | * @expectedExceptionMessage Unknown argument "unknown" for function "date". | ||
43 | */ | ||
44 | public function testGetArgumentsWithWrongNamedArgumentName() | ||
45 | { | ||
46 | $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); | ||
47 | $node->getArguments('date', array('Y-m-d', 'unknown' => '')); | ||
48 | } | ||
49 | |||
50 | /** | ||
51 | * @expectedException Twig_Error_Syntax | ||
52 | * @expectedExceptionMessage Unknown arguments "unknown1", "unknown2" for function "date". | ||
53 | */ | ||
54 | public function testGetArgumentsWithWrongNamedArgumentNames() | ||
55 | { | ||
56 | $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); | ||
57 | $node->getArguments('date', array('Y-m-d', 'unknown1' => '', 'unknown2' => '')); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | class Twig_Tests_Node_Expression_Call extends Twig_Node_Expression_Call | ||
62 | { | ||
63 | public function getArguments($callable, $arguments) | ||
64 | { | ||
65 | return parent::getArguments($callable, $arguments); | ||
66 | } | ||
67 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php deleted file mode 100644 index 9906d512..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_ConditionalTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Conditional::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr1 = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $expr2 = new Twig_Node_Expression_Constant(2, 1); | ||
21 | $expr3 = new Twig_Node_Expression_Constant(3, 1); | ||
22 | $node = new Twig_Node_Expression_Conditional($expr1, $expr2, $expr3, 1); | ||
23 | |||
24 | $this->assertEquals($expr1, $node->getNode('expr1')); | ||
25 | $this->assertEquals($expr2, $node->getNode('expr2')); | ||
26 | $this->assertEquals($expr3, $node->getNode('expr3')); | ||
27 | } | ||
28 | |||
29 | /** | ||
30 | * @covers Twig_Node_Expression_Conditional::compile | ||
31 | * @dataProvider getTests | ||
32 | */ | ||
33 | public function testCompile($node, $source, $environment = null) | ||
34 | { | ||
35 | parent::testCompile($node, $source, $environment); | ||
36 | } | ||
37 | |||
38 | public function getTests() | ||
39 | { | ||
40 | $tests = array(); | ||
41 | |||
42 | $expr1 = new Twig_Node_Expression_Constant(1, 1); | ||
43 | $expr2 = new Twig_Node_Expression_Constant(2, 1); | ||
44 | $expr3 = new Twig_Node_Expression_Constant(3, 1); | ||
45 | $node = new Twig_Node_Expression_Conditional($expr1, $expr2, $expr3, 1); | ||
46 | $tests[] = array($node, '((1) ? (2) : (3))'); | ||
47 | |||
48 | return $tests; | ||
49 | } | ||
50 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php deleted file mode 100644 index d0dec531..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_ConstantTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Constant::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $node = new Twig_Node_Expression_Constant('foo', 1); | ||
20 | |||
21 | $this->assertEquals('foo', $node->getAttribute('value')); | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * @covers Twig_Node_Expression_Constant::compile | ||
26 | * @dataProvider getTests | ||
27 | */ | ||
28 | public function testCompile($node, $source, $environment = null) | ||
29 | { | ||
30 | parent::testCompile($node, $source, $environment); | ||
31 | } | ||
32 | |||
33 | public function getTests() | ||
34 | { | ||
35 | $tests = array(); | ||
36 | |||
37 | $node = new Twig_Node_Expression_Constant('foo', 1); | ||
38 | $tests[] = array($node, '"foo"'); | ||
39 | |||
40 | return $tests; | ||
41 | } | ||
42 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php deleted file mode 100644 index 8089b9cb..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_FilterTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Filter::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr = new Twig_Node_Expression_Constant('foo', 1); | ||
20 | $name = new Twig_Node_Expression_Constant('upper', 1); | ||
21 | $args = new Twig_Node(); | ||
22 | $node = new Twig_Node_Expression_Filter($expr, $name, $args, 1); | ||
23 | |||
24 | $this->assertEquals($expr, $node->getNode('node')); | ||
25 | $this->assertEquals($name, $node->getNode('filter')); | ||
26 | $this->assertEquals($args, $node->getNode('arguments')); | ||
27 | } | ||
28 | |||
29 | /** | ||
30 | * @covers Twig_Node_Expression_Filter::compile | ||
31 | * @dataProvider getTests | ||
32 | */ | ||
33 | public function testCompile($node, $source, $environment = null) | ||
34 | { | ||
35 | parent::testCompile($node, $source, $environment); | ||
36 | } | ||
37 | |||
38 | public function getTests() | ||
39 | { | ||
40 | $tests = array(); | ||
41 | |||
42 | $expr = new Twig_Node_Expression_Constant('foo', 1); | ||
43 | $node = $this->createFilter($expr, 'upper'); | ||
44 | $node = $this->createFilter($node, 'number_format', array(new Twig_Node_Expression_Constant(2, 1), new Twig_Node_Expression_Constant('.', 1), new Twig_Node_Expression_Constant(',', 1))); | ||
45 | |||
46 | if (function_exists('mb_get_info')) { | ||
47 | $tests[] = array($node, 'twig_number_format_filter($this->env, twig_upper_filter($this->env, "foo"), 2, ".", ",")'); | ||
48 | } else { | ||
49 | $tests[] = array($node, 'twig_number_format_filter($this->env, strtoupper("foo"), 2, ".", ",")'); | ||
50 | } | ||
51 | |||
52 | // named arguments | ||
53 | $date = new Twig_Node_Expression_Constant(0, 1); | ||
54 | $node = $this->createFilter($date, 'date', array( | ||
55 | 'timezone' => new Twig_Node_Expression_Constant('America/Chicago', 1), | ||
56 | 'format' => new Twig_Node_Expression_Constant('d/m/Y H:i:s P', 1), | ||
57 | )); | ||
58 | $tests[] = array($node, 'twig_date_format_filter($this->env, 0, "d/m/Y H:i:s P", "America/Chicago")'); | ||
59 | |||
60 | // skip an optional argument | ||
61 | $date = new Twig_Node_Expression_Constant(0, 1); | ||
62 | $node = $this->createFilter($date, 'date', array( | ||
63 | 'timezone' => new Twig_Node_Expression_Constant('America/Chicago', 1), | ||
64 | )); | ||
65 | $tests[] = array($node, 'twig_date_format_filter($this->env, 0, null, "America/Chicago")'); | ||
66 | |||
67 | // underscores vs camelCase for named arguments | ||
68 | $string = new Twig_Node_Expression_Constant('abc', 1); | ||
69 | $node = $this->createFilter($string, 'reverse', array( | ||
70 | 'preserve_keys' => new Twig_Node_Expression_Constant(true, 1), | ||
71 | )); | ||
72 | $tests[] = array($node, 'twig_reverse_filter($this->env, "abc", true)'); | ||
73 | $node = $this->createFilter($string, 'reverse', array( | ||
74 | 'preserveKeys' => new Twig_Node_Expression_Constant(true, 1), | ||
75 | )); | ||
76 | $tests[] = array($node, 'twig_reverse_filter($this->env, "abc", true)'); | ||
77 | |||
78 | // filter as an anonymous function | ||
79 | if (version_compare(phpversion(), '5.3.0', '>=')) { | ||
80 | $node = $this->createFilter(new Twig_Node_Expression_Constant('foo', 1), 'anonymous'); | ||
81 | $tests[] = array($node, 'call_user_func_array($this->env->getFilter(\'anonymous\')->getCallable(), array("foo"))'); | ||
82 | } | ||
83 | |||
84 | return $tests; | ||
85 | } | ||
86 | |||
87 | /** | ||
88 | * @expectedException Twig_Error_Syntax | ||
89 | * @expectedExceptionMessage Unknown argument "foobar" for filter "date". | ||
90 | */ | ||
91 | public function testCompileWithWrongNamedArgumentName() | ||
92 | { | ||
93 | $date = new Twig_Node_Expression_Constant(0, 1); | ||
94 | $node = $this->createFilter($date, 'date', array( | ||
95 | 'foobar' => new Twig_Node_Expression_Constant('America/Chicago', 1), | ||
96 | )); | ||
97 | |||
98 | $compiler = $this->getCompiler(); | ||
99 | $compiler->compile($node); | ||
100 | } | ||
101 | |||
102 | /** | ||
103 | * @expectedException Twig_Error_Syntax | ||
104 | * @expectedExceptionMessage Value for argument "from" is required for filter "replace". | ||
105 | */ | ||
106 | public function testCompileWithMissingNamedArgument() | ||
107 | { | ||
108 | $value = new Twig_Node_Expression_Constant(0, 1); | ||
109 | $node = $this->createFilter($value, 'replace', array( | ||
110 | 'to' => new Twig_Node_Expression_Constant('foo', 1), | ||
111 | )); | ||
112 | |||
113 | $compiler = $this->getCompiler(); | ||
114 | $compiler->compile($node); | ||
115 | } | ||
116 | |||
117 | protected function createFilter($node, $name, array $arguments = array()) | ||
118 | { | ||
119 | $name = new Twig_Node_Expression_Constant($name, 1); | ||
120 | $arguments = new Twig_Node($arguments); | ||
121 | |||
122 | return new Twig_Node_Expression_Filter($node, $name, $arguments, 1); | ||
123 | } | ||
124 | |||
125 | protected function getEnvironment() | ||
126 | { | ||
127 | if (version_compare(phpversion(), '5.3.0', '>=')) { | ||
128 | return include 'PHP53/FilterInclude.php'; | ||
129 | } | ||
130 | |||
131 | return parent::getEnvironment(); | ||
132 | } | ||
133 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php deleted file mode 100644 index 431dc387..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_FunctionTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Function::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $name = 'function'; | ||
20 | $args = new Twig_Node(); | ||
21 | $node = new Twig_Node_Expression_Function($name, $args, 1); | ||
22 | |||
23 | $this->assertEquals($name, $node->getAttribute('name')); | ||
24 | $this->assertEquals($args, $node->getNode('arguments')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Expression_Function::compile | ||
29 | * @dataProvider getTests | ||
30 | */ | ||
31 | public function testCompile($node, $source, $environment = null) | ||
32 | { | ||
33 | parent::testCompile($node, $source, $environment); | ||
34 | } | ||
35 | |||
36 | public function getTests() | ||
37 | { | ||
38 | $environment = new Twig_Environment(); | ||
39 | $environment->addFunction('foo', new Twig_Function_Function('foo', array())); | ||
40 | $environment->addFunction('bar', new Twig_Function_Function('bar', array('needs_environment' => true))); | ||
41 | $environment->addFunction('foofoo', new Twig_Function_Function('foofoo', array('needs_context' => true))); | ||
42 | $environment->addFunction('foobar', new Twig_Function_Function('foobar', array('needs_environment' => true, 'needs_context' => true))); | ||
43 | |||
44 | $tests = array(); | ||
45 | |||
46 | $node = $this->createFunction('foo'); | ||
47 | $tests[] = array($node, 'foo()', $environment); | ||
48 | |||
49 | $node = $this->createFunction('foo', array(new Twig_Node_Expression_Constant('bar', 1), new Twig_Node_Expression_Constant('foobar', 1))); | ||
50 | $tests[] = array($node, 'foo("bar", "foobar")', $environment); | ||
51 | |||
52 | $node = $this->createFunction('bar'); | ||
53 | $tests[] = array($node, 'bar($this->env)', $environment); | ||
54 | |||
55 | $node = $this->createFunction('bar', array(new Twig_Node_Expression_Constant('bar', 1))); | ||
56 | $tests[] = array($node, 'bar($this->env, "bar")', $environment); | ||
57 | |||
58 | $node = $this->createFunction('foofoo'); | ||
59 | $tests[] = array($node, 'foofoo($context)', $environment); | ||
60 | |||
61 | $node = $this->createFunction('foofoo', array(new Twig_Node_Expression_Constant('bar', 1))); | ||
62 | $tests[] = array($node, 'foofoo($context, "bar")', $environment); | ||
63 | |||
64 | $node = $this->createFunction('foobar'); | ||
65 | $tests[] = array($node, 'foobar($this->env, $context)', $environment); | ||
66 | |||
67 | $node = $this->createFunction('foobar', array(new Twig_Node_Expression_Constant('bar', 1))); | ||
68 | $tests[] = array($node, 'foobar($this->env, $context, "bar")', $environment); | ||
69 | |||
70 | // named arguments | ||
71 | $node = $this->createFunction('date', array( | ||
72 | 'timezone' => new Twig_Node_Expression_Constant('America/Chicago', 1), | ||
73 | 'date' => new Twig_Node_Expression_Constant(0, 1), | ||
74 | )); | ||
75 | $tests[] = array($node, 'twig_date_converter($this->env, 0, "America/Chicago")'); | ||
76 | |||
77 | // function as an anonymous function | ||
78 | if (version_compare(phpversion(), '5.3.0', '>=')) { | ||
79 | $node = $this->createFunction('anonymous', array(new Twig_Node_Expression_Constant('foo', 1))); | ||
80 | $tests[] = array($node, 'call_user_func_array($this->env->getFunction(\'anonymous\')->getCallable(), array("foo"))'); | ||
81 | } | ||
82 | |||
83 | return $tests; | ||
84 | } | ||
85 | |||
86 | protected function createFunction($name, array $arguments = array()) | ||
87 | { | ||
88 | return new Twig_Node_Expression_Function($name, new Twig_Node($arguments), 1); | ||
89 | } | ||
90 | |||
91 | protected function getEnvironment() | ||
92 | { | ||
93 | if (version_compare(phpversion(), '5.3.0', '>=')) { | ||
94 | return include 'PHP53/FunctionInclude.php'; | ||
95 | } | ||
96 | |||
97 | return parent::getEnvironment(); | ||
98 | } | ||
99 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php deleted file mode 100644 index 6a63cce6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_GetAttrTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_GetAttr::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr = new Twig_Node_Expression_Name('foo', 1); | ||
20 | $attr = new Twig_Node_Expression_Constant('bar', 1); | ||
21 | $args = new Twig_Node_Expression_Array(array(), 1); | ||
22 | $args->addElement(new Twig_Node_Expression_Name('foo', 1)); | ||
23 | $args->addElement(new Twig_Node_Expression_Constant('bar', 1)); | ||
24 | $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_TemplateInterface::ARRAY_CALL, 1); | ||
25 | |||
26 | $this->assertEquals($expr, $node->getNode('node')); | ||
27 | $this->assertEquals($attr, $node->getNode('attribute')); | ||
28 | $this->assertEquals($args, $node->getNode('arguments')); | ||
29 | $this->assertEquals(Twig_TemplateInterface::ARRAY_CALL, $node->getAttribute('type')); | ||
30 | } | ||
31 | |||
32 | /** | ||
33 | * @covers Twig_Node_Expression_GetAttr::compile | ||
34 | * @dataProvider getTests | ||
35 | */ | ||
36 | public function testCompile($node, $source, $environment = null) | ||
37 | { | ||
38 | parent::testCompile($node, $source, $environment); | ||
39 | } | ||
40 | |||
41 | public function getTests() | ||
42 | { | ||
43 | $tests = array(); | ||
44 | |||
45 | $expr = new Twig_Node_Expression_Name('foo', 1); | ||
46 | $attr = new Twig_Node_Expression_Constant('bar', 1); | ||
47 | $args = new Twig_Node_Expression_Array(array(), 1); | ||
48 | $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_TemplateInterface::ANY_CALL, 1); | ||
49 | $tests[] = array($node, sprintf('%s%s, "bar")', $this->getAttributeGetter(), $this->getVariableGetter('foo'))); | ||
50 | |||
51 | $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_TemplateInterface::ARRAY_CALL, 1); | ||
52 | $tests[] = array($node, sprintf('%s%s, "bar", array(), "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo'))); | ||
53 | |||
54 | $args = new Twig_Node_Expression_Array(array(), 1); | ||
55 | $args->addElement(new Twig_Node_Expression_Name('foo', 1)); | ||
56 | $args->addElement(new Twig_Node_Expression_Constant('bar', 1)); | ||
57 | $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_TemplateInterface::METHOD_CALL, 1); | ||
58 | $tests[] = array($node, sprintf('%s%s, "bar", array(0 => %s, 1 => "bar"), "method")', $this->getAttributeGetter(), $this->getVariableGetter('foo'), $this->getVariableGetter('foo'))); | ||
59 | |||
60 | return $tests; | ||
61 | } | ||
62 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php deleted file mode 100644 index 76d109b6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_NameTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Name::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $node = new Twig_Node_Expression_Name('foo', 1); | ||
20 | |||
21 | $this->assertEquals('foo', $node->getAttribute('name')); | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * @covers Twig_Node_Expression_Name::compile | ||
26 | * @dataProvider getTests | ||
27 | */ | ||
28 | public function testCompile($node, $source, $environment = null) | ||
29 | { | ||
30 | parent::testCompile($node, $source, $environment); | ||
31 | } | ||
32 | |||
33 | public function getTests() | ||
34 | { | ||
35 | $node = new Twig_Node_Expression_Name('foo', 1); | ||
36 | $self = new Twig_Node_Expression_Name('_self', 1); | ||
37 | $context = new Twig_Node_Expression_Name('_context', 1); | ||
38 | |||
39 | $env = new Twig_Environment(null, array('strict_variables' => true)); | ||
40 | $env1 = new Twig_Environment(null, array('strict_variables' => false)); | ||
41 | |||
42 | return array( | ||
43 | version_compare(PHP_VERSION, '5.4.0') >= 0 ? array($node, '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))', $env) : array($node, '$this->getContext($context, "foo")', $env), | ||
44 | array($node, $this->getVariableGetter('foo'), $env1), | ||
45 | array($self, '$this'), | ||
46 | array($context, '$context'), | ||
47 | ); | ||
48 | } | ||
49 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php deleted file mode 100644 index 15e3aa96..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | $env = new Twig_Environment(); | ||
4 | $env->addFilter(new Twig_SimpleFilter('anonymous', function () {})); | ||
5 | |||
6 | return $env; | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php deleted file mode 100644 index d2170ed2..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | $env = new Twig_Environment(); | ||
4 | $env->addFunction(new Twig_SimpleFunction('anonymous', function () {})); | ||
5 | |||
6 | return $env; | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php deleted file mode 100644 index 63662864..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | $env = new Twig_Environment(); | ||
4 | $env->addTest(new Twig_SimpleTest('anonymous', function () {})); | ||
5 | |||
6 | return $env; | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php deleted file mode 100644 index 4d40419b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_ParentTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Parent::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $node = new Twig_Node_Expression_Parent('foo', 1); | ||
20 | |||
21 | $this->assertEquals('foo', $node->getAttribute('name')); | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * @covers Twig_Node_Expression_Parent::compile | ||
26 | * @dataProvider getTests | ||
27 | */ | ||
28 | public function testCompile($node, $source, $environment = null) | ||
29 | { | ||
30 | parent::testCompile($node, $source, $environment); | ||
31 | } | ||
32 | |||
33 | public function getTests() | ||
34 | { | ||
35 | $tests = array(); | ||
36 | $tests[] = array(new Twig_Node_Expression_Parent('foo', 1), '$this->renderParentBlock("foo", $context, $blocks)'); | ||
37 | |||
38 | return $tests; | ||
39 | } | ||
40 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php deleted file mode 100644 index 0664150a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_TestTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Test::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr = new Twig_Node_Expression_Constant('foo', 1); | ||
20 | $name = new Twig_Node_Expression_Constant('null', 1); | ||
21 | $args = new Twig_Node(); | ||
22 | $node = new Twig_Node_Expression_Test($expr, $name, $args, 1); | ||
23 | |||
24 | $this->assertEquals($expr, $node->getNode('node')); | ||
25 | $this->assertEquals($args, $node->getNode('arguments')); | ||
26 | $this->assertEquals($name, $node->getAttribute('name')); | ||
27 | } | ||
28 | |||
29 | /** | ||
30 | * @covers Twig_Node_Expression_Test::compile | ||
31 | * @dataProvider getTests | ||
32 | */ | ||
33 | public function testCompile($node, $source, $environment = null) | ||
34 | { | ||
35 | parent::testCompile($node, $source, $environment); | ||
36 | } | ||
37 | |||
38 | public function getTests() | ||
39 | { | ||
40 | $tests = array(); | ||
41 | |||
42 | $expr = new Twig_Node_Expression_Constant('foo', 1); | ||
43 | $node = new Twig_Node_Expression_Test_Null($expr, 'null', new Twig_Node(array()), 1); | ||
44 | $tests[] = array($node, '(null === "foo")'); | ||
45 | |||
46 | // test as an anonymous function | ||
47 | if (version_compare(phpversion(), '5.3.0', '>=')) { | ||
48 | $node = $this->createTest(new Twig_Node_Expression_Constant('foo', 1), 'anonymous', array(new Twig_Node_Expression_Constant('foo', 1))); | ||
49 | $tests[] = array($node, 'call_user_func_array($this->env->getTest(\'anonymous\')->getCallable(), array("foo", "foo"))'); | ||
50 | } | ||
51 | |||
52 | return $tests; | ||
53 | } | ||
54 | |||
55 | protected function createTest($node, $name, array $arguments = array()) | ||
56 | { | ||
57 | return new Twig_Node_Expression_Test($node, $name, new Twig_Node($arguments), 1); | ||
58 | } | ||
59 | |||
60 | protected function getEnvironment() | ||
61 | { | ||
62 | if (version_compare(phpversion(), '5.3.0', '>=')) { | ||
63 | return include 'PHP53/TestInclude.php'; | ||
64 | } | ||
65 | |||
66 | return parent::getEnvironment(); | ||
67 | } | ||
68 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php deleted file mode 100644 index d55ab333..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Unary_NegTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Unary_Neg::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $node = new Twig_Node_Expression_Unary_Neg($expr, 1); | ||
21 | |||
22 | $this->assertEquals($expr, $node->getNode('node')); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @covers Twig_Node_Expression_Unary_Neg::compile | ||
27 | * @covers Twig_Node_Expression_Unary_Neg::operator | ||
28 | * @dataProvider getTests | ||
29 | */ | ||
30 | public function testCompile($node, $source, $environment = null) | ||
31 | { | ||
32 | parent::testCompile($node, $source, $environment); | ||
33 | } | ||
34 | |||
35 | public function getTests() | ||
36 | { | ||
37 | $node = new Twig_Node_Expression_Constant(1, 1); | ||
38 | $node = new Twig_Node_Expression_Unary_Neg($node, 1); | ||
39 | |||
40 | return array( | ||
41 | array($node, '(-1)'), | ||
42 | ); | ||
43 | } | ||
44 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php deleted file mode 100644 index 625c2527..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Unary_NotTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Unary_Not::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $node = new Twig_Node_Expression_Unary_Not($expr, 1); | ||
21 | |||
22 | $this->assertEquals($expr, $node->getNode('node')); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @covers Twig_Node_Expression_Unary_Not::compile | ||
27 | * @covers Twig_Node_Expression_Unary_Not::operator | ||
28 | * @dataProvider getTests | ||
29 | */ | ||
30 | public function testCompile($node, $source, $environment = null) | ||
31 | { | ||
32 | parent::testCompile($node, $source, $environment); | ||
33 | } | ||
34 | |||
35 | public function getTests() | ||
36 | { | ||
37 | $node = new Twig_Node_Expression_Constant(1, 1); | ||
38 | $node = new Twig_Node_Expression_Unary_Not($node, 1); | ||
39 | |||
40 | return array( | ||
41 | array($node, '(!1)'), | ||
42 | ); | ||
43 | } | ||
44 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php deleted file mode 100644 index 047a0977..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_Expression_Unary_PosTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Expression_Unary_Pos::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr = new Twig_Node_Expression_Constant(1, 1); | ||
20 | $node = new Twig_Node_Expression_Unary_Pos($expr, 1); | ||
21 | |||
22 | $this->assertEquals($expr, $node->getNode('node')); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @covers Twig_Node_Expression_Unary_Pos::compile | ||
27 | * @covers Twig_Node_Expression_Unary_Pos::operator | ||
28 | * @dataProvider getTests | ||
29 | */ | ||
30 | public function testCompile($node, $source, $environment = null) | ||
31 | { | ||
32 | parent::testCompile($node, $source, $environment); | ||
33 | } | ||
34 | |||
35 | public function getTests() | ||
36 | { | ||
37 | $node = new Twig_Node_Expression_Constant(1, 1); | ||
38 | $node = new Twig_Node_Expression_Unary_Pos($node, 1); | ||
39 | |||
40 | return array( | ||
41 | array($node, '(+1)'), | ||
42 | ); | ||
43 | } | ||
44 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php deleted file mode 100644 index 21cc84e6..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php +++ /dev/null | |||
@@ -1,203 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_ForTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_For::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $keyTarget = new Twig_Node_Expression_AssignName('key', 1); | ||
20 | $valueTarget = new Twig_Node_Expression_AssignName('item', 1); | ||
21 | $seq = new Twig_Node_Expression_Name('items', 1); | ||
22 | $ifexpr = new Twig_Node_Expression_Constant(true, 1); | ||
23 | $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1)), array(), 1); | ||
24 | $else = null; | ||
25 | $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); | ||
26 | $node->setAttribute('with_loop', false); | ||
27 | |||
28 | $this->assertEquals($keyTarget, $node->getNode('key_target')); | ||
29 | $this->assertEquals($valueTarget, $node->getNode('value_target')); | ||
30 | $this->assertEquals($seq, $node->getNode('seq')); | ||
31 | $this->assertTrue($node->getAttribute('ifexpr')); | ||
32 | $this->assertEquals('Twig_Node_If', get_class($node->getNode('body'))); | ||
33 | $this->assertEquals($body, $node->getNode('body')->getNode('tests')->getNode(1)->getNode(0)); | ||
34 | $this->assertEquals(null, $node->getNode('else')); | ||
35 | |||
36 | $else = new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1); | ||
37 | $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); | ||
38 | $node->setAttribute('with_loop', false); | ||
39 | $this->assertEquals($else, $node->getNode('else')); | ||
40 | } | ||
41 | |||
42 | /** | ||
43 | * @covers Twig_Node_For::compile | ||
44 | * @dataProvider getTests | ||
45 | */ | ||
46 | public function testCompile($node, $source, $environment = null) | ||
47 | { | ||
48 | parent::testCompile($node, $source, $environment); | ||
49 | } | ||
50 | |||
51 | public function getTests() | ||
52 | { | ||
53 | $tests = array(); | ||
54 | |||
55 | $keyTarget = new Twig_Node_Expression_AssignName('key', 1); | ||
56 | $valueTarget = new Twig_Node_Expression_AssignName('item', 1); | ||
57 | $seq = new Twig_Node_Expression_Name('items', 1); | ||
58 | $ifexpr = null; | ||
59 | $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1)), array(), 1); | ||
60 | $else = null; | ||
61 | $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); | ||
62 | $node->setAttribute('with_loop', false); | ||
63 | |||
64 | $tests[] = array($node, <<<EOF | ||
65 | // line 1 | ||
66 | \$context['_parent'] = (array) \$context; | ||
67 | \$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('items')}); | ||
68 | foreach (\$context['_seq'] as \$context["key"] => \$context["item"]) { | ||
69 | echo {$this->getVariableGetter('foo')}; | ||
70 | } | ||
71 | \$_parent = \$context['_parent']; | ||
72 | unset(\$context['_seq'], \$context['_iterated'], \$context['key'], \$context['item'], \$context['_parent'], \$context['loop']); | ||
73 | \$context = array_intersect_key(\$context, \$_parent) + \$_parent; | ||
74 | EOF | ||
75 | ); | ||
76 | |||
77 | $keyTarget = new Twig_Node_Expression_AssignName('k', 1); | ||
78 | $valueTarget = new Twig_Node_Expression_AssignName('v', 1); | ||
79 | $seq = new Twig_Node_Expression_Name('values', 1); | ||
80 | $ifexpr = null; | ||
81 | $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1)), array(), 1); | ||
82 | $else = null; | ||
83 | $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); | ||
84 | $node->setAttribute('with_loop', true); | ||
85 | |||
86 | $tests[] = array($node, <<<EOF | ||
87 | // line 1 | ||
88 | \$context['_parent'] = (array) \$context; | ||
89 | \$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('values')}); | ||
90 | \$context['loop'] = array( | ||
91 | 'parent' => \$context['_parent'], | ||
92 | 'index0' => 0, | ||
93 | 'index' => 1, | ||
94 | 'first' => true, | ||
95 | ); | ||
96 | if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) { | ||
97 | \$length = count(\$context['_seq']); | ||
98 | \$context['loop']['revindex0'] = \$length - 1; | ||
99 | \$context['loop']['revindex'] = \$length; | ||
100 | \$context['loop']['length'] = \$length; | ||
101 | \$context['loop']['last'] = 1 === \$length; | ||
102 | } | ||
103 | foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { | ||
104 | echo {$this->getVariableGetter('foo')}; | ||
105 | ++\$context['loop']['index0']; | ||
106 | ++\$context['loop']['index']; | ||
107 | \$context['loop']['first'] = false; | ||
108 | if (isset(\$context['loop']['length'])) { | ||
109 | --\$context['loop']['revindex0']; | ||
110 | --\$context['loop']['revindex']; | ||
111 | \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; | ||
112 | } | ||
113 | } | ||
114 | \$_parent = \$context['_parent']; | ||
115 | unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); | ||
116 | \$context = array_intersect_key(\$context, \$_parent) + \$_parent; | ||
117 | EOF | ||
118 | ); | ||
119 | |||
120 | $keyTarget = new Twig_Node_Expression_AssignName('k', 1); | ||
121 | $valueTarget = new Twig_Node_Expression_AssignName('v', 1); | ||
122 | $seq = new Twig_Node_Expression_Name('values', 1); | ||
123 | $ifexpr = new Twig_Node_Expression_Constant(true, 1); | ||
124 | $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1)), array(), 1); | ||
125 | $else = null; | ||
126 | $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); | ||
127 | $node->setAttribute('with_loop', true); | ||
128 | |||
129 | $tests[] = array($node, <<<EOF | ||
130 | // line 1 | ||
131 | \$context['_parent'] = (array) \$context; | ||
132 | \$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('values')}); | ||
133 | \$context['loop'] = array( | ||
134 | 'parent' => \$context['_parent'], | ||
135 | 'index0' => 0, | ||
136 | 'index' => 1, | ||
137 | 'first' => true, | ||
138 | ); | ||
139 | foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { | ||
140 | if (true) { | ||
141 | echo {$this->getVariableGetter('foo')}; | ||
142 | ++\$context['loop']['index0']; | ||
143 | ++\$context['loop']['index']; | ||
144 | \$context['loop']['first'] = false; | ||
145 | } | ||
146 | } | ||
147 | \$_parent = \$context['_parent']; | ||
148 | unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); | ||
149 | \$context = array_intersect_key(\$context, \$_parent) + \$_parent; | ||
150 | EOF | ||
151 | ); | ||
152 | |||
153 | $keyTarget = new Twig_Node_Expression_AssignName('k', 1); | ||
154 | $valueTarget = new Twig_Node_Expression_AssignName('v', 1); | ||
155 | $seq = new Twig_Node_Expression_Name('values', 1); | ||
156 | $ifexpr = null; | ||
157 | $body = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1)), array(), 1); | ||
158 | $else = new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1); | ||
159 | $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); | ||
160 | $node->setAttribute('with_loop', true); | ||
161 | |||
162 | $tests[] = array($node, <<<EOF | ||
163 | // line 1 | ||
164 | \$context['_parent'] = (array) \$context; | ||
165 | \$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('values')}); | ||
166 | \$context['_iterated'] = false; | ||
167 | \$context['loop'] = array( | ||
168 | 'parent' => \$context['_parent'], | ||
169 | 'index0' => 0, | ||
170 | 'index' => 1, | ||
171 | 'first' => true, | ||
172 | ); | ||
173 | if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) { | ||
174 | \$length = count(\$context['_seq']); | ||
175 | \$context['loop']['revindex0'] = \$length - 1; | ||
176 | \$context['loop']['revindex'] = \$length; | ||
177 | \$context['loop']['length'] = \$length; | ||
178 | \$context['loop']['last'] = 1 === \$length; | ||
179 | } | ||
180 | foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { | ||
181 | echo {$this->getVariableGetter('foo')}; | ||
182 | \$context['_iterated'] = true; | ||
183 | ++\$context['loop']['index0']; | ||
184 | ++\$context['loop']['index']; | ||
185 | \$context['loop']['first'] = false; | ||
186 | if (isset(\$context['loop']['length'])) { | ||
187 | --\$context['loop']['revindex0']; | ||
188 | --\$context['loop']['revindex']; | ||
189 | \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; | ||
190 | } | ||
191 | } | ||
192 | if (!\$context['_iterated']) { | ||
193 | echo {$this->getVariableGetter('foo')}; | ||
194 | } | ||
195 | \$_parent = \$context['_parent']; | ||
196 | unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); | ||
197 | \$context = array_intersect_key(\$context, \$_parent) + \$_parent; | ||
198 | EOF | ||
199 | ); | ||
200 | |||
201 | return $tests; | ||
202 | } | ||
203 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php b/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php deleted file mode 100644 index 92fc29dc..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_IfTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_If::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $t = new Twig_Node(array( | ||
20 | new Twig_Node_Expression_Constant(true, 1), | ||
21 | new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1), | ||
22 | ), array(), 1); | ||
23 | $else = null; | ||
24 | $node = new Twig_Node_If($t, $else, 1); | ||
25 | |||
26 | $this->assertEquals($t, $node->getNode('tests')); | ||
27 | $this->assertEquals(null, $node->getNode('else')); | ||
28 | |||
29 | $else = new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 1), 1); | ||
30 | $node = new Twig_Node_If($t, $else, 1); | ||
31 | $this->assertEquals($else, $node->getNode('else')); | ||
32 | } | ||
33 | |||
34 | /** | ||
35 | * @covers Twig_Node_If::compile | ||
36 | * @dataProvider getTests | ||
37 | */ | ||
38 | public function testCompile($node, $source, $environment = null) | ||
39 | { | ||
40 | parent::testCompile($node, $source, $environment); | ||
41 | } | ||
42 | |||
43 | public function getTests() | ||
44 | { | ||
45 | $tests = array(); | ||
46 | |||
47 | $t = new Twig_Node(array( | ||
48 | new Twig_Node_Expression_Constant(true, 1), | ||
49 | new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1), | ||
50 | ), array(), 1); | ||
51 | $else = null; | ||
52 | $node = new Twig_Node_If($t, $else, 1); | ||
53 | |||
54 | $tests[] = array($node, <<<EOF | ||
55 | // line 1 | ||
56 | if (true) { | ||
57 | echo {$this->getVariableGetter('foo')}; | ||
58 | } | ||
59 | EOF | ||
60 | ); | ||
61 | |||
62 | $t = new Twig_Node(array( | ||
63 | new Twig_Node_Expression_Constant(true, 1), | ||
64 | new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1), | ||
65 | new Twig_Node_Expression_Constant(false, 1), | ||
66 | new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 1), 1), | ||
67 | ), array(), 1); | ||
68 | $else = null; | ||
69 | $node = new Twig_Node_If($t, $else, 1); | ||
70 | |||
71 | $tests[] = array($node, <<<EOF | ||
72 | // line 1 | ||
73 | if (true) { | ||
74 | echo {$this->getVariableGetter('foo')}; | ||
75 | } elseif (false) { | ||
76 | echo {$this->getVariableGetter('bar')}; | ||
77 | } | ||
78 | EOF | ||
79 | ); | ||
80 | |||
81 | $t = new Twig_Node(array( | ||
82 | new Twig_Node_Expression_Constant(true, 1), | ||
83 | new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1), | ||
84 | ), array(), 1); | ||
85 | $else = new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 1), 1); | ||
86 | $node = new Twig_Node_If($t, $else, 1); | ||
87 | |||
88 | $tests[] = array($node, <<<EOF | ||
89 | // line 1 | ||
90 | if (true) { | ||
91 | echo {$this->getVariableGetter('foo')}; | ||
92 | } else { | ||
93 | echo {$this->getVariableGetter('bar')}; | ||
94 | } | ||
95 | EOF | ||
96 | ); | ||
97 | |||
98 | return $tests; | ||
99 | } | ||
100 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php deleted file mode 100644 index db36581a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_ImportTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Import::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $macro = new Twig_Node_Expression_Constant('foo.twig', 1); | ||
20 | $var = new Twig_Node_Expression_AssignName('macro', 1); | ||
21 | $node = new Twig_Node_Import($macro, $var, 1); | ||
22 | |||
23 | $this->assertEquals($macro, $node->getNode('expr')); | ||
24 | $this->assertEquals($var, $node->getNode('var')); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @covers Twig_Node_Import::compile | ||
29 | * @dataProvider getTests | ||
30 | */ | ||
31 | public function testCompile($node, $source, $environment = null) | ||
32 | { | ||
33 | parent::testCompile($node, $source, $environment); | ||
34 | } | ||
35 | |||
36 | public function getTests() | ||
37 | { | ||
38 | $tests = array(); | ||
39 | |||
40 | $macro = new Twig_Node_Expression_Constant('foo.twig', 1); | ||
41 | $var = new Twig_Node_Expression_AssignName('macro', 1); | ||
42 | $node = new Twig_Node_Import($macro, $var, 1); | ||
43 | |||
44 | $tests[] = array($node, <<<EOF | ||
45 | // line 1 | ||
46 | \$context["macro"] = \$this->env->loadTemplate("foo.twig"); | ||
47 | EOF | ||
48 | ); | ||
49 | |||
50 | return $tests; | ||
51 | } | ||
52 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php b/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php deleted file mode 100644 index 3b7da6e0..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_IncludeTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Include::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr = new Twig_Node_Expression_Constant('foo.twig', 1); | ||
20 | $node = new Twig_Node_Include($expr, null, false, false, 1); | ||
21 | |||
22 | $this->assertEquals(null, $node->getNode('variables')); | ||
23 | $this->assertEquals($expr, $node->getNode('expr')); | ||
24 | $this->assertFalse($node->getAttribute('only')); | ||
25 | |||
26 | $vars = new Twig_Node_Expression_Array(array(new Twig_Node_Expression_Constant('foo', 1), new Twig_Node_Expression_Constant(true, 1)), 1); | ||
27 | $node = new Twig_Node_Include($expr, $vars, true, false, 1); | ||
28 | $this->assertEquals($vars, $node->getNode('variables')); | ||
29 | $this->assertTrue($node->getAttribute('only')); | ||
30 | } | ||
31 | |||
32 | /** | ||
33 | * @covers Twig_Node_Include::compile | ||
34 | * @dataProvider getTests | ||
35 | */ | ||
36 | public function testCompile($node, $source, $environment = null) | ||
37 | { | ||
38 | parent::testCompile($node, $source, $environment); | ||
39 | } | ||
40 | |||
41 | public function getTests() | ||
42 | { | ||
43 | $tests = array(); | ||
44 | |||
45 | $expr = new Twig_Node_Expression_Constant('foo.twig', 1); | ||
46 | $node = new Twig_Node_Include($expr, null, false, false, 1); | ||
47 | $tests[] = array($node, <<<EOF | ||
48 | // line 1 | ||
49 | \$this->env->loadTemplate("foo.twig")->display(\$context); | ||
50 | EOF | ||
51 | ); | ||
52 | |||
53 | $expr = new Twig_Node_Expression_Conditional( | ||
54 | new Twig_Node_Expression_Constant(true, 1), | ||
55 | new Twig_Node_Expression_Constant('foo', 1), | ||
56 | new Twig_Node_Expression_Constant('foo', 1), | ||
57 | 0 | ||
58 | ); | ||
59 | $node = new Twig_Node_Include($expr, null, false, false, 1); | ||
60 | $tests[] = array($node, <<<EOF | ||
61 | // line 1 | ||
62 | \$template = \$this->env->resolveTemplate(((true) ? ("foo") : ("foo"))); | ||
63 | \$template->display(\$context); | ||
64 | EOF | ||
65 | ); | ||
66 | |||
67 | $expr = new Twig_Node_Expression_Constant('foo.twig', 1); | ||
68 | $vars = new Twig_Node_Expression_Array(array(new Twig_Node_Expression_Constant('foo', 1), new Twig_Node_Expression_Constant(true, 1)), 1); | ||
69 | $node = new Twig_Node_Include($expr, $vars, false, false, 1); | ||
70 | $tests[] = array($node, <<<EOF | ||
71 | // line 1 | ||
72 | \$this->env->loadTemplate("foo.twig")->display(array_merge(\$context, array("foo" => true))); | ||
73 | EOF | ||
74 | ); | ||
75 | |||
76 | $node = new Twig_Node_Include($expr, $vars, true, false, 1); | ||
77 | $tests[] = array($node, <<<EOF | ||
78 | // line 1 | ||
79 | \$this->env->loadTemplate("foo.twig")->display(array("foo" => true)); | ||
80 | EOF | ||
81 | ); | ||
82 | |||
83 | $node = new Twig_Node_Include($expr, $vars, true, true, 1); | ||
84 | $tests[] = array($node, <<<EOF | ||
85 | // line 1 | ||
86 | try { | ||
87 | \$this->env->loadTemplate("foo.twig")->display(array("foo" => true)); | ||
88 | } catch (Twig_Error_Loader \$e) { | ||
89 | // ignore missing template | ||
90 | } | ||
91 | EOF | ||
92 | ); | ||
93 | |||
94 | return $tests; | ||
95 | } | ||
96 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php b/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php deleted file mode 100644 index 4d2f641b..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_MacroTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Macro::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $body = new Twig_Node_Text('foo', 1); | ||
20 | $arguments = new Twig_Node(array(new Twig_Node_Expression_Name('foo', 1)), array(), 1); | ||
21 | $node = new Twig_Node_Macro('foo', $body, $arguments, 1); | ||
22 | |||
23 | $this->assertEquals($body, $node->getNode('body')); | ||
24 | $this->assertEquals($arguments, $node->getNode('arguments')); | ||
25 | $this->assertEquals('foo', $node->getAttribute('name')); | ||
26 | } | ||
27 | |||
28 | /** | ||
29 | * @covers Twig_Node_Macro::compile | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $body = new Twig_Node_Text('foo', 1); | ||
40 | $arguments = new Twig_Node(array( | ||
41 | 'foo' => new Twig_Node_Expression_Constant(null, 1), | ||
42 | 'bar' => new Twig_Node_Expression_Constant('Foo', 1), | ||
43 | ), array(), 1); | ||
44 | $node = new Twig_Node_Macro('foo', $body, $arguments, 1); | ||
45 | |||
46 | return array( | ||
47 | array($node, <<<EOF | ||
48 | // line 1 | ||
49 | public function getfoo(\$_foo = null, \$_bar = "Foo") | ||
50 | { | ||
51 | \$context = \$this->env->mergeGlobals(array( | ||
52 | "foo" => \$_foo, | ||
53 | "bar" => \$_bar, | ||
54 | )); | ||
55 | |||
56 | \$blocks = array(); | ||
57 | |||
58 | ob_start(); | ||
59 | try { | ||
60 | echo "foo"; | ||
61 | } catch (Exception \$e) { | ||
62 | ob_end_clean(); | ||
63 | |||
64 | throw \$e; | ||
65 | } | ||
66 | |||
67 | return ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset()); | ||
68 | } | ||
69 | EOF | ||
70 | ), | ||
71 | ); | ||
72 | } | ||
73 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php deleted file mode 100644 index 9411e99e..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php +++ /dev/null | |||
@@ -1,196 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_ModuleTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Module::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $body = new Twig_Node_Text('foo', 1); | ||
20 | $parent = new Twig_Node_Expression_Constant('layout.twig', 1); | ||
21 | $blocks = new Twig_Node(); | ||
22 | $macros = new Twig_Node(); | ||
23 | $traits = new Twig_Node(); | ||
24 | $filename = 'foo.twig'; | ||
25 | $node = new Twig_Node_Module($body, $parent, $blocks, $macros, $traits, new Twig_Node(array()), $filename); | ||
26 | |||
27 | $this->assertEquals($body, $node->getNode('body')); | ||
28 | $this->assertEquals($blocks, $node->getNode('blocks')); | ||
29 | $this->assertEquals($macros, $node->getNode('macros')); | ||
30 | $this->assertEquals($parent, $node->getNode('parent')); | ||
31 | $this->assertEquals($filename, $node->getAttribute('filename')); | ||
32 | } | ||
33 | |||
34 | /** | ||
35 | * @covers Twig_Node_Module::compile | ||
36 | * @covers Twig_Node_Module::compileTemplate | ||
37 | * @covers Twig_Node_Module::compileMacros | ||
38 | * @covers Twig_Node_Module::compileClassHeader | ||
39 | * @covers Twig_Node_Module::compileDisplayHeader | ||
40 | * @covers Twig_Node_Module::compileDisplayBody | ||
41 | * @covers Twig_Node_Module::compileDisplayFooter | ||
42 | * @covers Twig_Node_Module::compileClassFooter | ||
43 | * @dataProvider getTests | ||
44 | */ | ||
45 | public function testCompile($node, $source, $environment = null) | ||
46 | { | ||
47 | parent::testCompile($node, $source, $environment); | ||
48 | } | ||
49 | |||
50 | public function getTests() | ||
51 | { | ||
52 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
53 | |||
54 | $tests = array(); | ||
55 | |||
56 | $body = new Twig_Node_Text('foo', 1); | ||
57 | $extends = null; | ||
58 | $blocks = new Twig_Node(); | ||
59 | $macros = new Twig_Node(); | ||
60 | $traits = new Twig_Node(); | ||
61 | $filename = 'foo.twig'; | ||
62 | |||
63 | $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); | ||
64 | $tests[] = array($node, <<<EOF | ||
65 | <?php | ||
66 | |||
67 | /* foo.twig */ | ||
68 | class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template | ||
69 | { | ||
70 | public function __construct(Twig_Environment \$env) | ||
71 | { | ||
72 | parent::__construct(\$env); | ||
73 | |||
74 | \$this->parent = false; | ||
75 | |||
76 | \$this->blocks = array( | ||
77 | ); | ||
78 | } | ||
79 | |||
80 | protected function doDisplay(array \$context, array \$blocks = array()) | ||
81 | { | ||
82 | // line 1 | ||
83 | echo "foo"; | ||
84 | } | ||
85 | |||
86 | public function getTemplateName() | ||
87 | { | ||
88 | return "foo.twig"; | ||
89 | } | ||
90 | |||
91 | public function getDebugInfo() | ||
92 | { | ||
93 | return array ( 19 => 1,); | ||
94 | } | ||
95 | } | ||
96 | EOF | ||
97 | , $twig); | ||
98 | |||
99 | $import = new Twig_Node_Import(new Twig_Node_Expression_Constant('foo.twig', 1), new Twig_Node_Expression_AssignName('macro', 1), 1); | ||
100 | |||
101 | $body = new Twig_Node(array($import)); | ||
102 | $extends = new Twig_Node_Expression_Constant('layout.twig', 1); | ||
103 | |||
104 | $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); | ||
105 | $tests[] = array($node, <<<EOF | ||
106 | <?php | ||
107 | |||
108 | /* foo.twig */ | ||
109 | class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template | ||
110 | { | ||
111 | public function __construct(Twig_Environment \$env) | ||
112 | { | ||
113 | parent::__construct(\$env); | ||
114 | |||
115 | \$this->parent = \$this->env->loadTemplate("layout.twig"); | ||
116 | |||
117 | \$this->blocks = array( | ||
118 | ); | ||
119 | } | ||
120 | |||
121 | protected function doGetParent(array \$context) | ||
122 | { | ||
123 | return "layout.twig"; | ||
124 | } | ||
125 | |||
126 | protected function doDisplay(array \$context, array \$blocks = array()) | ||
127 | { | ||
128 | // line 1 | ||
129 | \$context["macro"] = \$this->env->loadTemplate("foo.twig"); | ||
130 | \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); | ||
131 | } | ||
132 | |||
133 | public function getTemplateName() | ||
134 | { | ||
135 | return "foo.twig"; | ||
136 | } | ||
137 | |||
138 | public function isTraitable() | ||
139 | { | ||
140 | return false; | ||
141 | } | ||
142 | |||
143 | public function getDebugInfo() | ||
144 | { | ||
145 | return array ( 24 => 1,); | ||
146 | } | ||
147 | } | ||
148 | EOF | ||
149 | , $twig); | ||
150 | |||
151 | $body = new Twig_Node(); | ||
152 | $extends = new Twig_Node_Expression_Conditional( | ||
153 | new Twig_Node_Expression_Constant(true, 1), | ||
154 | new Twig_Node_Expression_Constant('foo', 1), | ||
155 | new Twig_Node_Expression_Constant('foo', 1), | ||
156 | 0 | ||
157 | ); | ||
158 | |||
159 | $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); | ||
160 | $tests[] = array($node, <<<EOF | ||
161 | <?php | ||
162 | |||
163 | /* foo.twig */ | ||
164 | class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template | ||
165 | { | ||
166 | protected function doGetParent(array \$context) | ||
167 | { | ||
168 | return \$this->env->resolveTemplate(((true) ? ("foo") : ("foo"))); | ||
169 | } | ||
170 | |||
171 | protected function doDisplay(array \$context, array \$blocks = array()) | ||
172 | { | ||
173 | \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks)); | ||
174 | } | ||
175 | |||
176 | public function getTemplateName() | ||
177 | { | ||
178 | return "foo.twig"; | ||
179 | } | ||
180 | |||
181 | public function isTraitable() | ||
182 | { | ||
183 | return false; | ||
184 | } | ||
185 | |||
186 | public function getDebugInfo() | ||
187 | { | ||
188 | return array (); | ||
189 | } | ||
190 | } | ||
191 | EOF | ||
192 | , $twig); | ||
193 | |||
194 | return $tests; | ||
195 | } | ||
196 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php b/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php deleted file mode 100644 index 6fe43a41..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_PrintTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Print::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $expr = new Twig_Node_Expression_Constant('foo', 1); | ||
20 | $node = new Twig_Node_Print($expr, 1); | ||
21 | |||
22 | $this->assertEquals($expr, $node->getNode('expr')); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @covers Twig_Node_Print::compile | ||
27 | * @dataProvider getTests | ||
28 | */ | ||
29 | public function testCompile($node, $source, $environment = null) | ||
30 | { | ||
31 | parent::testCompile($node, $source, $environment); | ||
32 | } | ||
33 | |||
34 | public function getTests() | ||
35 | { | ||
36 | $tests = array(); | ||
37 | $tests[] = array(new Twig_Node_Print(new Twig_Node_Expression_Constant('foo', 1), 1), "// line 1\necho \"foo\";"); | ||
38 | |||
39 | return $tests; | ||
40 | } | ||
41 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php deleted file mode 100644 index db9dbf95..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_SandboxTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Sandbox::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $body = new Twig_Node_Text('foo', 1); | ||
20 | $node = new Twig_Node_Sandbox($body, 1); | ||
21 | |||
22 | $this->assertEquals($body, $node->getNode('body')); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @covers Twig_Node_Sandbox::compile | ||
27 | * @dataProvider getTests | ||
28 | */ | ||
29 | public function testCompile($node, $source, $environment = null) | ||
30 | { | ||
31 | parent::testCompile($node, $source, $environment); | ||
32 | } | ||
33 | |||
34 | public function getTests() | ||
35 | { | ||
36 | $tests = array(); | ||
37 | |||
38 | $body = new Twig_Node_Text('foo', 1); | ||
39 | $node = new Twig_Node_Sandbox($body, 1); | ||
40 | |||
41 | $tests[] = array($node, <<<EOF | ||
42 | // line 1 | ||
43 | \$sandbox = \$this->env->getExtension('sandbox'); | ||
44 | if (!\$alreadySandboxed = \$sandbox->isSandboxed()) { | ||
45 | \$sandbox->enableSandbox(); | ||
46 | } | ||
47 | echo "foo"; | ||
48 | if (!\$alreadySandboxed) { | ||
49 | \$sandbox->disableSandbox(); | ||
50 | } | ||
51 | EOF | ||
52 | ); | ||
53 | |||
54 | return $tests; | ||
55 | } | ||
56 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php deleted file mode 100644 index 217e3408..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php +++ /dev/null | |||
@@ -1,173 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_SandboxedModuleTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_SandboxedModule::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $body = new Twig_Node_Text('foo', 1); | ||
20 | $parent = new Twig_Node_Expression_Constant('layout.twig', 1); | ||
21 | $blocks = new Twig_Node(); | ||
22 | $macros = new Twig_Node(); | ||
23 | $traits = new Twig_Node(); | ||
24 | $filename = 'foo.twig'; | ||
25 | $node = new Twig_Node_Module($body, $parent, $blocks, $macros, $traits, new Twig_Node(array()), $filename); | ||
26 | $node = new Twig_Node_SandboxedModule($node, array('for'), array('upper'), array('cycle')); | ||
27 | |||
28 | $this->assertEquals($body, $node->getNode('body')); | ||
29 | $this->assertEquals($blocks, $node->getNode('blocks')); | ||
30 | $this->assertEquals($macros, $node->getNode('macros')); | ||
31 | $this->assertEquals($parent, $node->getNode('parent')); | ||
32 | $this->assertEquals($filename, $node->getAttribute('filename')); | ||
33 | } | ||
34 | |||
35 | /** | ||
36 | * @covers Twig_Node_SandboxedModule::compile | ||
37 | * @covers Twig_Node_SandboxedModule::compileDisplayBody | ||
38 | * @covers Twig_Node_SandboxedModule::compileDisplayFooter | ||
39 | * @dataProvider getTests | ||
40 | */ | ||
41 | public function testCompile($node, $source, $environment = null) | ||
42 | { | ||
43 | parent::testCompile($node, $source, $environment); | ||
44 | } | ||
45 | |||
46 | public function getTests() | ||
47 | { | ||
48 | $twig = new Twig_Environment(new Twig_Loader_String()); | ||
49 | |||
50 | $tests = array(); | ||
51 | |||
52 | $body = new Twig_Node_Text('foo', 1); | ||
53 | $extends = null; | ||
54 | $blocks = new Twig_Node(); | ||
55 | $macros = new Twig_Node(); | ||
56 | $traits = new Twig_Node(); | ||
57 | $filename = 'foo.twig'; | ||
58 | |||
59 | $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); | ||
60 | $node = new Twig_Node_SandboxedModule($node, array('for'), array('upper'), array('cycle')); | ||
61 | |||
62 | $tests[] = array($node, <<<EOF | ||
63 | <?php | ||
64 | |||
65 | /* foo.twig */ | ||
66 | class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template | ||
67 | { | ||
68 | public function __construct(Twig_Environment \$env) | ||
69 | { | ||
70 | parent::__construct(\$env); | ||
71 | |||
72 | \$this->parent = false; | ||
73 | |||
74 | \$this->blocks = array( | ||
75 | ); | ||
76 | } | ||
77 | |||
78 | protected function doDisplay(array \$context, array \$blocks = array()) | ||
79 | { | ||
80 | \$this->checkSecurity(); | ||
81 | // line 1 | ||
82 | echo "foo"; | ||
83 | } | ||
84 | |||
85 | protected function checkSecurity() | ||
86 | { | ||
87 | \$this->env->getExtension('sandbox')->checkSecurity( | ||
88 | array('upper'), | ||
89 | array('for'), | ||
90 | array('cycle') | ||
91 | ); | ||
92 | } | ||
93 | |||
94 | public function getTemplateName() | ||
95 | { | ||
96 | return "foo.twig"; | ||
97 | } | ||
98 | |||
99 | public function getDebugInfo() | ||
100 | { | ||
101 | return array ( 20 => 1,); | ||
102 | } | ||
103 | } | ||
104 | EOF | ||
105 | , $twig); | ||
106 | |||
107 | $body = new Twig_Node(); | ||
108 | $extends = new Twig_Node_Expression_Constant('layout.twig', 1); | ||
109 | $blocks = new Twig_Node(); | ||
110 | $macros = new Twig_Node(); | ||
111 | $traits = new Twig_Node(); | ||
112 | $filename = 'foo.twig'; | ||
113 | |||
114 | $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); | ||
115 | $node = new Twig_Node_SandboxedModule($node, array('for'), array('upper'), array('cycle')); | ||
116 | |||
117 | $tests[] = array($node, <<<EOF | ||
118 | <?php | ||
119 | |||
120 | /* foo.twig */ | ||
121 | class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template | ||
122 | { | ||
123 | public function __construct(Twig_Environment \$env) | ||
124 | { | ||
125 | parent::__construct(\$env); | ||
126 | |||
127 | \$this->parent = \$this->env->loadTemplate("layout.twig"); | ||
128 | |||
129 | \$this->blocks = array( | ||
130 | ); | ||
131 | } | ||
132 | |||
133 | protected function doGetParent(array \$context) | ||
134 | { | ||
135 | return "layout.twig"; | ||
136 | } | ||
137 | |||
138 | protected function doDisplay(array \$context, array \$blocks = array()) | ||
139 | { | ||
140 | \$this->checkSecurity(); | ||
141 | \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); | ||
142 | } | ||
143 | |||
144 | protected function checkSecurity() | ||
145 | { | ||
146 | \$this->env->getExtension('sandbox')->checkSecurity( | ||
147 | array('upper'), | ||
148 | array('for'), | ||
149 | array('cycle') | ||
150 | ); | ||
151 | } | ||
152 | |||
153 | public function getTemplateName() | ||
154 | { | ||
155 | return "foo.twig"; | ||
156 | } | ||
157 | |||
158 | public function isTraitable() | ||
159 | { | ||
160 | return false; | ||
161 | } | ||
162 | |||
163 | public function getDebugInfo() | ||
164 | { | ||
165 | return array (); | ||
166 | } | ||
167 | } | ||
168 | EOF | ||
169 | , $twig); | ||
170 | |||
171 | return $tests; | ||
172 | } | ||
173 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php deleted file mode 100644 index 058e02bc..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_SandboxedPrintTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_SandboxedPrint::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $node = new Twig_Node_SandboxedPrint($expr = new Twig_Node_Expression_Constant('foo', 1), 1); | ||
20 | |||
21 | $this->assertEquals($expr, $node->getNode('expr')); | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * @covers Twig_Node_SandboxedPrint::compile | ||
26 | * @dataProvider getTests | ||
27 | */ | ||
28 | public function testCompile($node, $source, $environment = null) | ||
29 | { | ||
30 | parent::testCompile($node, $source, $environment); | ||
31 | } | ||
32 | |||
33 | public function getTests() | ||
34 | { | ||
35 | $tests = array(); | ||
36 | |||
37 | $tests[] = array(new Twig_Node_SandboxedPrint(new Twig_Node_Expression_Constant('foo', 1), 1), <<<EOF | ||
38 | // line 1 | ||
39 | echo \$this->env->getExtension('sandbox')->ensureToStringAllowed("foo"); | ||
40 | EOF | ||
41 | ); | ||
42 | |||
43 | return $tests; | ||
44 | } | ||
45 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php deleted file mode 100644 index d64d671a..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_SetTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Set::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 1)), array(), 1); | ||
20 | $values = new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 1)), array(), 1); | ||
21 | $node = new Twig_Node_Set(false, $names, $values, 1); | ||
22 | |||
23 | $this->assertEquals($names, $node->getNode('names')); | ||
24 | $this->assertEquals($values, $node->getNode('values')); | ||
25 | $this->assertEquals(false, $node->getAttribute('capture')); | ||
26 | } | ||
27 | |||
28 | /** | ||
29 | * @covers Twig_Node_Set::compile | ||
30 | * @dataProvider getTests | ||
31 | */ | ||
32 | public function testCompile($node, $source, $environment = null) | ||
33 | { | ||
34 | parent::testCompile($node, $source, $environment); | ||
35 | } | ||
36 | |||
37 | public function getTests() | ||
38 | { | ||
39 | $tests = array(); | ||
40 | |||
41 | $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 1)), array(), 1); | ||
42 | $values = new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 1)), array(), 1); | ||
43 | $node = new Twig_Node_Set(false, $names, $values, 1); | ||
44 | $tests[] = array($node, <<<EOF | ||
45 | // line 1 | ||
46 | \$context["foo"] = "foo"; | ||
47 | EOF | ||
48 | ); | ||
49 | |||
50 | $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 1)), array(), 1); | ||
51 | $values = new Twig_Node(array(new Twig_Node_Print(new Twig_Node_Expression_Constant('foo', 1), 1)), array(), 1); | ||
52 | $node = new Twig_Node_Set(true, $names, $values, 1); | ||
53 | $tests[] = array($node, <<<EOF | ||
54 | // line 1 | ||
55 | ob_start(); | ||
56 | echo "foo"; | ||
57 | \$context["foo"] = ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset()); | ||
58 | EOF | ||
59 | ); | ||
60 | |||
61 | $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 1)), array(), 1); | ||
62 | $values = new Twig_Node_Text('foo', 1); | ||
63 | $node = new Twig_Node_Set(true, $names, $values, 1); | ||
64 | $tests[] = array($node, <<<EOF | ||
65 | // line 1 | ||
66 | \$context["foo"] = ('' === \$tmp = "foo") ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset()); | ||
67 | EOF | ||
68 | ); | ||
69 | |||
70 | $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 1), new Twig_Node_Expression_AssignName('bar', 1)), array(), 1); | ||
71 | $values = new Twig_Node(array(new Twig_Node_Expression_Constant('foo', 1), new Twig_Node_Expression_Name('bar', 1)), array(), 1); | ||
72 | $node = new Twig_Node_Set(false, $names, $values, 1); | ||
73 | $tests[] = array($node, <<<EOF | ||
74 | // line 1 | ||
75 | list(\$context["foo"], \$context["bar"]) = array("foo", {$this->getVariableGetter('bar')}); | ||
76 | EOF | ||
77 | ); | ||
78 | |||
79 | return $tests; | ||
80 | } | ||
81 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php deleted file mode 100644 index 6735dc31..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_SpacelessTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Spaceless::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $body = new Twig_Node(array(new Twig_Node_Text('<div> <div> foo </div> </div>', 1))); | ||
20 | $node = new Twig_Node_Spaceless($body, 1); | ||
21 | |||
22 | $this->assertEquals($body, $node->getNode('body')); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * @covers Twig_Node_Spaceless::compile | ||
27 | * @dataProvider getTests | ||
28 | */ | ||
29 | public function testCompile($node, $source, $environment = null) | ||
30 | { | ||
31 | parent::testCompile($node, $source, $environment); | ||
32 | } | ||
33 | |||
34 | public function getTests() | ||
35 | { | ||
36 | $body = new Twig_Node(array(new Twig_Node_Text('<div> <div> foo </div> </div>', 1))); | ||
37 | $node = new Twig_Node_Spaceless($body, 1); | ||
38 | |||
39 | return array( | ||
40 | array($node, <<<EOF | ||
41 | // line 1 | ||
42 | ob_start(); | ||
43 | echo "<div> <div> foo </div> </div>"; | ||
44 | echo trim(preg_replace('/>\s+</', '><', ob_get_clean())); | ||
45 | EOF | ||
46 | ), | ||
47 | ); | ||
48 | } | ||
49 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php b/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php deleted file mode 100644 index 6f85576e..00000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_Node_TextTest extends Twig_Test_NodeTestCase | ||
13 | { | ||
14 | /** | ||
15 | * @covers Twig_Node_Text::__construct | ||
16 | */ | ||
17 | public function testConstructor() | ||
18 | { | ||
19 | $node = new Twig_Node_Text('foo', 1); | ||
20 | |||
21 | $this->assertEquals('foo', $node->getAttribute('data')); | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * @covers Twig_Node_Text::compile | ||
26 | * @dataProvider getTests | ||
27 | */ | ||
28 | public function testCompile($node, $source, $environment = null) | ||
29 | { | ||
30 | parent::testCompile($node, $source, $environment); | ||
31 | } | ||
32 | |||
33 | public function getTests() | ||
34 | { | ||
35 | $tests = array(); | ||
36 | $tests[] = array(new Twig_Node_Text('foo', 1), "// line 1\necho \"foo\";"); | ||
37 | |||
38 | return $tests; | ||
39 | } | ||
40 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php b/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php deleted file mode 100644 index d35740d5..00000000 --- a/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php +++ /dev/null | |||
@@ -1,114 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | class Twig_Tests_NodeVisitor_OptimizerTest extends PHPUnit_Framework_TestCase | ||
12 | { | ||
13 | public function testRenderBlockOptimizer() | ||
14 | { | ||
15 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
16 | |||
17 | $stream = $env->parse($env->tokenize('{{ block("foo") }}', 'index')); | ||
18 | |||
19 | $node = $stream->getNode('body')->getNode(0); | ||
20 | |||
21 | $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node)); | ||
22 | $this->assertTrue($node->getAttribute('output')); | ||
23 | } | ||
24 | |||
25 | public function testRenderParentBlockOptimizer() | ||
26 | { | ||
27 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
28 | |||
29 | $stream = $env->parse($env->tokenize('{% extends "foo" %}{% block content %}{{ parent() }}{% endblock %}', 'index')); | ||
30 | |||
31 | $node = $stream->getNode('blocks')->getNode('content')->getNode(0)->getNode('body'); | ||
32 | |||
33 | $this->assertEquals('Twig_Node_Expression_Parent', get_class($node)); | ||
34 | $this->assertTrue($node->getAttribute('output')); | ||
35 | } | ||
36 | |||
37 | public function testRenderVariableBlockOptimizer() | ||
38 | { | ||
39 | if (version_compare(phpversion(), '5.4.0RC1', '>=')) { | ||
40 | return; | ||
41 | } | ||
42 | |||
43 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false)); | ||
44 | $stream = $env->parse($env->tokenize('{{ block(name|lower) }}', 'index')); | ||
45 | |||
46 | $node = $stream->getNode('body')->getNode(0)->getNode(1); | ||
47 | |||
48 | $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node)); | ||
49 | $this->assertTrue($node->getAttribute('output')); | ||
50 | } | ||
51 | |||
52 | /** | ||
53 | * @dataProvider getTestsForForOptimizer | ||
54 | */ | ||
55 | public function testForOptimizer($template, $expected) | ||
56 | { | ||
57 | $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false)); | ||
58 | |||
59 | $stream = $env->parse($env->tokenize($template, 'index')); | ||
60 | |||
61 | foreach ($expected as $target => $withLoop) { | ||
62 | $this->assertTrue($this->checkForConfiguration($stream, $target, $withLoop), sprintf('variable %s is %soptimized', $target, $withLoop ? 'not ' : '')); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | public function getTestsForForOptimizer() | ||
67 | { | ||
68 | return array( | ||
69 | array('{% for i in foo %}{% endfor %}', array('i' => false)), | ||
70 | |||
71 | array('{% for i in foo %}{{ loop.index }}{% endfor %}', array('i' => true)), | ||
72 | |||
73 | array('{% for i in foo %}{% for j in foo %}{% endfor %}{% endfor %}', array('i' => false, 'j' => false)), | ||
74 | |||
75 | array('{% for i in foo %}{% include "foo" %}{% endfor %}', array('i' => true)), | ||
76 | |||
77 | array('{% for i in foo %}{% include "foo" only %}{% endfor %}', array('i' => false)), | ||
78 | |||
79 | array('{% for i in foo %}{% include "foo" with { "foo": "bar" } only %}{% endfor %}', array('i' => false)), | ||
80 | |||
81 | array('{% for i in foo %}{% include "foo" with { "foo": loop.index } only %}{% endfor %}', array('i' => true)), | ||
82 | |||
83 | array('{% for i in foo %}{% for j in foo %}{{ loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => true)), | ||
84 | |||
85 | array('{% for i in foo %}{% for j in foo %}{{ loop.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)), | ||
86 | |||
87 | array('{% for i in foo %}{% set l = loop %}{% for j in foo %}{{ l.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => false)), | ||
88 | |||
89 | array('{% for i in foo %}{% for j in foo %}{{ foo.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => false)), | ||
90 | |||
91 | array('{% for i in foo %}{% for j in foo %}{{ loop["parent"].loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)), | ||
92 | ); | ||
93 | } | ||
94 | |||
95 | public function checkForConfiguration(Twig_NodeInterface $node = null, $target, $withLoop) | ||
96 | { | ||
97 | if (null === $node) { | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | foreach ($node as $n) { | ||
102 | if ($n instanceof Twig_Node_For) { | ||
103 | if ($target === $n->getNode('value_target')->getAttribute('name')) { | ||
104 | return $withLoop == $n->getAttribute('with_loop'); | ||
105 | } | ||
106 | } | ||
107 | |||
108 | $ret = $this->checkForConfiguration($n, $target, $withLoop); | ||
109 | if (null !== $ret) { | ||
110 | return $ret; | ||
111 | } | ||
112 | } | ||
113 | } | ||
114 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/ParserTest.php b/vendor/twig/twig/test/Twig/Tests/ParserTest.php deleted file mode 100644 index 55eb7fb4..00000000 --- a/vendor/twig/twig/test/Twig/Tests/ParserTest.php +++ /dev/null | |||
@@ -1,180 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | class Twig_Tests_ParserTest extends PHPUnit_Framework_TestCase | ||
12 | { | ||
13 | /** | ||
14 | * @expectedException Twig_Error_Syntax | ||
15 | */ | ||
16 | public function testSetMacroThrowsExceptionOnReservedMethods() | ||
17 | { | ||
18 | $parser = $this->getParser(); | ||
19 | $parser->setMacro('display', $this->getMock('Twig_Node_Macro', array(), array(), '', null)); | ||
20 | } | ||
21 | |||
22 | /** | ||
23 | * @expectedException Twig_Error_Syntax | ||
24 | * @expectedExceptionMessage Unknown tag name "foo". Did you mean "for" at line 1 | ||
25 | */ | ||
26 | public function testUnknownTag() | ||
27 | { | ||
28 | $stream = new Twig_TokenStream(array( | ||
29 | new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1), | ||
30 | new Twig_Token(Twig_Token::NAME_TYPE, 'foo', 1), | ||
31 | new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1), | ||
32 | new Twig_Token(Twig_Token::EOF_TYPE, '', 1), | ||
33 | )); | ||
34 | $parser = new Twig_Parser(new Twig_Environment()); | ||
35 | $parser->parse($stream); | ||
36 | } | ||
37 | |||
38 | /** | ||
39 | * @dataProvider getFilterBodyNodesData | ||
40 | */ | ||
41 | public function testFilterBodyNodes($input, $expected) | ||
42 | { | ||
43 | $parser = $this->getParser(); | ||
44 | |||
45 | $this->assertEquals($expected, $parser->filterBodyNodes($input)); | ||
46 | } | ||
47 | |||
48 | public function getFilterBodyNodesData() | ||
49 | { | ||
50 | return array( | ||
51 | array( | ||
52 | new Twig_Node(array(new Twig_Node_Text(' ', 1))), | ||
53 | new Twig_Node(array()), | ||
54 | ), | ||
55 | array( | ||
56 | $input = new Twig_Node(array(new Twig_Node_Set(false, new Twig_Node(), new Twig_Node(), 1))), | ||
57 | $input, | ||
58 | ), | ||
59 | array( | ||
60 | $input = new Twig_Node(array(new Twig_Node_Set(true, new Twig_Node(), new Twig_Node(array(new Twig_Node(array(new Twig_Node_Text('foo', 1))))), 1))), | ||
61 | $input, | ||
62 | ), | ||
63 | ); | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * @dataProvider getFilterBodyNodesDataThrowsException | ||
68 | * @expectedException Twig_Error_Syntax | ||
69 | */ | ||
70 | public function testFilterBodyNodesThrowsException($input) | ||
71 | { | ||
72 | $parser = $this->getParser(); | ||
73 | |||
74 | $parser->filterBodyNodes($input); | ||
75 | } | ||
76 | |||
77 | public function getFilterBodyNodesDataThrowsException() | ||
78 | { | ||
79 | return array( | ||
80 | array(new Twig_Node_Text('foo', 1)), | ||
81 | array(new Twig_Node(array(new Twig_Node(array(new Twig_Node_Text('foo', 1)))))), | ||
82 | ); | ||
83 | } | ||
84 | |||
85 | /** | ||
86 | * @expectedException Twig_Error_Syntax | ||
87 | * @expectedExceptionMessage A template that extends another one cannot have a body but a byte order mark (BOM) has been detected; it must be removed at line 1. | ||
88 | */ | ||
89 | public function testFilterBodyNodesWithBOM() | ||
90 | { | ||
91 | $parser = $this->getParser(); | ||
92 | $parser->filterBodyNodes(new Twig_Node_Text(chr(0xEF).chr(0xBB).chr(0xBF), 1)); | ||
93 | } | ||
94 | |||
95 | public function testParseIsReentrant() | ||
96 | { | ||
97 | $twig = new Twig_Environment(null, array( | ||
98 | 'autoescape' => false, | ||
99 | 'optimizations' => 0, | ||
100 | )); | ||
101 | $twig->addTokenParser(new TestTokenParser()); | ||
102 | |||
103 | $parser = new Twig_Parser($twig); | ||
104 | |||
105 | $parser->parse(new Twig_TokenStream(array( | ||
106 | new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1), | ||
107 | new Twig_Token(Twig_Token::NAME_TYPE, 'test', 1), | ||
108 | new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1), | ||
109 | new Twig_Token(Twig_Token::VAR_START_TYPE, '', 1), | ||
110 | new Twig_Token(Twig_Token::NAME_TYPE, 'foo', 1), | ||
111 | new Twig_Token(Twig_Token::VAR_END_TYPE, '', 1), | ||
112 | new Twig_Token(Twig_Token::EOF_TYPE, '', 1), | ||
113 | ))); | ||
114 | |||
115 | $this->assertEquals(null, $parser->getParent()); | ||
116 | } | ||
117 | |||
118 | // The getVarName() must not depend on the template loaders, | ||
119 | // If this test does not throw any exception, that's good. | ||
120 | // see https://github.com/symfony/symfony/issues/4218 | ||
121 | public function testGetVarName() | ||
122 | { | ||
123 | $twig = new Twig_Environment(null, array( | ||
124 | 'autoescape' => false, | ||
125 | 'optimizations' => 0, | ||
126 | )); | ||
127 | |||
128 | $twig->parse($twig->tokenize(<<<EOF | ||
129 | {% from _self import foo %} | ||
130 | |||
131 | {% macro foo() %} | ||
132 | {{ foo }} | ||
133 | {% endmacro %} | ||
134 | EOF | ||
135 | )); | ||
136 | } | ||
137 | |||
138 | protected function getParser() | ||
139 | { | ||
140 | $parser = new TestParser(new Twig_Environment()); | ||
141 | $parser->setParent(new Twig_Node()); | ||
142 | $parser->stream = $this->getMockBuilder('Twig_TokenStream')->disableOriginalConstructor()->getMock(); | ||
143 | |||
144 | return $parser; | ||
145 | } | ||
146 | } | ||
147 | |||
148 | class TestParser extends Twig_Parser | ||
149 | { | ||
150 | public $stream; | ||
151 | |||
152 | public function filterBodyNodes(Twig_NodeInterface $node) | ||
153 | { | ||
154 | return parent::filterBodyNodes($node); | ||
155 | } | ||
156 | } | ||
157 | |||
158 | class TestTokenParser extends Twig_TokenParser | ||
159 | { | ||
160 | public function parse(Twig_Token $token) | ||
161 | { | ||
162 | // simulate the parsing of another template right in the middle of the parsing of the current template | ||
163 | $this->parser->parse(new Twig_TokenStream(array( | ||
164 | new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1), | ||
165 | new Twig_Token(Twig_Token::NAME_TYPE, 'extends', 1), | ||
166 | new Twig_Token(Twig_Token::STRING_TYPE, 'base', 1), | ||
167 | new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1), | ||
168 | new Twig_Token(Twig_Token::EOF_TYPE, '', 1), | ||
169 | ))); | ||
170 | |||
171 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); | ||
172 | |||
173 | return new Twig_Node(array()); | ||
174 | } | ||
175 | |||
176 | public function getTag() | ||
177 | { | ||
178 | return 'test'; | ||
179 | } | ||
180 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/TemplateTest.php b/vendor/twig/twig/test/Twig/Tests/TemplateTest.php deleted file mode 100644 index 823a9ce9..00000000 --- a/vendor/twig/twig/test/Twig/Tests/TemplateTest.php +++ /dev/null | |||
@@ -1,626 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase | ||
12 | { | ||
13 | /** | ||
14 | * @dataProvider getAttributeExceptions | ||
15 | */ | ||
16 | public function testGetAttributeExceptions($template, $message, $useExt) | ||
17 | { | ||
18 | $name = 'index_'.($useExt ? 1 : 0); | ||
19 | $templates = array( | ||
20 | $name => $template.$useExt, // appending $useExt makes the template content unique | ||
21 | ); | ||
22 | |||
23 | $env = new Twig_Environment(new Twig_Loader_Array($templates), array('strict_variables' => true)); | ||
24 | if (!$useExt) { | ||
25 | $env->addNodeVisitor(new CExtDisablingNodeVisitor()); | ||
26 | } | ||
27 | $template = $env->loadTemplate($name); | ||
28 | |||
29 | $context = array( | ||
30 | 'string' => 'foo', | ||
31 | 'array' => array('foo' => 'foo'), | ||
32 | 'array_access' => new Twig_TemplateArrayAccessObject(), | ||
33 | 'magic_exception' => new Twig_TemplateMagicPropertyObjectWithException(), | ||
34 | ); | ||
35 | |||
36 | try { | ||
37 | $template->render($context); | ||
38 | $this->fail('Accessing an invalid attribute should throw an exception.'); | ||
39 | } catch (Twig_Error_Runtime $e) { | ||
40 | $this->assertSame(sprintf($message, $name), $e->getMessage()); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | public function getAttributeExceptions() | ||
45 | { | ||
46 | $tests = array( | ||
47 | array('{{ string["a"] }}', 'Impossible to access a key ("a") on a string variable ("foo") in "%s" at line 1', false), | ||
48 | array('{{ array["a"] }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1', false), | ||
49 | array('{{ array_access["a"] }}', 'Key "a" in object (with ArrayAccess) of type "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false), | ||
50 | array('{{ string.a }}', 'Impossible to access an attribute ("a") on a string variable ("foo") in "%s" at line 1', false), | ||
51 | array('{{ string.a() }}', 'Impossible to invoke a method ("a") on a string variable ("foo") in "%s" at line 1', false), | ||
52 | array('{{ array.a }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1', false), | ||
53 | array('{{ attribute(array, -10) }}', 'Key "-10" for array with keys "foo" does not exist in "%s" at line 1', false), | ||
54 | array('{{ array_access.a }}', 'Method "a" for object "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false), | ||
55 | array('{% macro foo(obj) %}{{ obj.missing_method() }}{% endmacro %}{{ _self.foo(array_access) }}', 'Method "missing_method" for object "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false), | ||
56 | array('{{ magic_exception.test }}', 'An exception has been thrown during the rendering of a template ("Hey! Don\'t try to isset me!") in "%s" at line 1.', false), | ||
57 | ); | ||
58 | |||
59 | if (function_exists('twig_template_get_attributes')) { | ||
60 | foreach (array_slice($tests, 0) as $test) { | ||
61 | $test[2] = true; | ||
62 | $tests[] = $test; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | return $tests; | ||
67 | } | ||
68 | |||
69 | /** | ||
70 | * @dataProvider getGetAttributeWithSandbox | ||
71 | */ | ||
72 | public function testGetAttributeWithSandbox($object, $item, $allowed, $useExt) | ||
73 | { | ||
74 | $twig = new Twig_Environment(); | ||
75 | $policy = new Twig_Sandbox_SecurityPolicy(array(), array(), array(/*method*/), array(/*prop*/), array()); | ||
76 | $twig->addExtension(new Twig_Extension_Sandbox($policy, !$allowed)); | ||
77 | $template = new Twig_TemplateTest($twig, $useExt); | ||
78 | |||
79 | try { | ||
80 | $template->getAttribute($object, $item, array(), 'any'); | ||
81 | |||
82 | if (!$allowed) { | ||
83 | $this->fail(); | ||
84 | } | ||
85 | } catch (Twig_Sandbox_SecurityError $e) { | ||
86 | if ($allowed) { | ||
87 | $this->fail(); | ||
88 | } | ||
89 | |||
90 | $this->assertContains('is not allowed', $e->getMessage()); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | public function getGetAttributeWithSandbox() | ||
95 | { | ||
96 | $tests = array( | ||
97 | array(new Twig_TemplatePropertyObject(), 'defined', false, false), | ||
98 | array(new Twig_TemplatePropertyObject(), 'defined', true, false), | ||
99 | array(new Twig_TemplateMethodObject(), 'defined', false, false), | ||
100 | array(new Twig_TemplateMethodObject(), 'defined', true, false), | ||
101 | ); | ||
102 | |||
103 | if (function_exists('twig_template_get_attributes')) { | ||
104 | foreach (array_slice($tests, 0) as $test) { | ||
105 | $test[3] = true; | ||
106 | $tests[] = $test; | ||
107 | } | ||
108 | } | ||
109 | |||
110 | return $tests; | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * @dataProvider getGetAttributeWithTemplateAsObject | ||
115 | */ | ||
116 | public function testGetAttributeWithTemplateAsObject($useExt) | ||
117 | { | ||
118 | $template = new Twig_TemplateTest(new Twig_Environment(), $useExt); | ||
119 | $template1 = new Twig_TemplateTest(new Twig_Environment(), false); | ||
120 | |||
121 | $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'string')); | ||
122 | $this->assertEquals('some_string', $template->getAttribute($template1, 'string')); | ||
123 | |||
124 | $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'true')); | ||
125 | $this->assertEquals('1', $template->getAttribute($template1, 'true')); | ||
126 | |||
127 | $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'zero')); | ||
128 | $this->assertEquals('0', $template->getAttribute($template1, 'zero')); | ||
129 | |||
130 | $this->assertNotInstanceof('Twig_Markup', $template->getAttribute($template1, 'empty')); | ||
131 | $this->assertSame('', $template->getAttribute($template1, 'empty')); | ||
132 | } | ||
133 | |||
134 | public function getGetAttributeWithTemplateAsObject() | ||
135 | { | ||
136 | $bools = array( | ||
137 | array(false), | ||
138 | ); | ||
139 | |||
140 | if (function_exists('twig_template_get_attributes')) { | ||
141 | $bools[] = array(true); | ||
142 | } | ||
143 | |||
144 | return $bools; | ||
145 | } | ||
146 | |||
147 | /** | ||
148 | * @dataProvider getTestsDependingOnExtensionAvailability | ||
149 | */ | ||
150 | public function testGetAttributeOnArrayWithConfusableKey($useExt = false) | ||
151 | { | ||
152 | $template = new Twig_TemplateTest( | ||
153 | new Twig_Environment(), | ||
154 | $useExt | ||
155 | ); | ||
156 | |||
157 | $array = array('Zero', 'One', -1 => 'MinusOne', '' => 'EmptyString', '1.5' => 'FloatButString', '01' => 'IntegerButStringWithLeadingZeros'); | ||
158 | |||
159 | $this->assertSame('Zero', $array[false]); | ||
160 | $this->assertSame('One', $array[true]); | ||
161 | $this->assertSame('One', $array[1.5]); | ||
162 | $this->assertSame('One', $array['1']); | ||
163 | $this->assertSame('MinusOne', $array[-1.5]); | ||
164 | $this->assertSame('FloatButString', $array['1.5']); | ||
165 | $this->assertSame('IntegerButStringWithLeadingZeros', $array['01']); | ||
166 | $this->assertSame('EmptyString', $array[null]); | ||
167 | |||
168 | $this->assertSame('Zero', $template->getAttribute($array, false), 'false is treated as 0 when accessing an array (equals PHP behavior)'); | ||
169 | $this->assertSame('One', $template->getAttribute($array, true), 'true is treated as 1 when accessing an array (equals PHP behavior)'); | ||
170 | $this->assertSame('One', $template->getAttribute($array, 1.5), 'float is casted to int when accessing an array (equals PHP behavior)'); | ||
171 | $this->assertSame('One', $template->getAttribute($array, '1'), '"1" is treated as integer 1 when accessing an array (equals PHP behavior)'); | ||
172 | $this->assertSame('MinusOne', $template->getAttribute($array, -1.5), 'negative float is casted to int when accessing an array (equals PHP behavior)'); | ||
173 | $this->assertSame('FloatButString', $template->getAttribute($array, '1.5'), '"1.5" is treated as-is when accessing an array (equals PHP behavior)'); | ||
174 | $this->assertSame('IntegerButStringWithLeadingZeros', $template->getAttribute($array, '01'), '"01" is treated as-is when accessing an array (equals PHP behavior)'); | ||
175 | $this->assertSame('EmptyString', $template->getAttribute($array, null), 'null is treated as "" when accessing an array (equals PHP behavior)'); | ||
176 | } | ||
177 | |||
178 | public function getTestsDependingOnExtensionAvailability() | ||
179 | { | ||
180 | if (function_exists('twig_template_get_attributes')) { | ||
181 | return array(array(false), array(true)); | ||
182 | } | ||
183 | |||
184 | return array(array(false)); | ||
185 | } | ||
186 | |||
187 | /** | ||
188 | * @dataProvider getGetAttributeTests | ||
189 | */ | ||
190 | public function testGetAttribute($defined, $value, $object, $item, $arguments, $type, $useExt = false) | ||
191 | { | ||
192 | $template = new Twig_TemplateTest(new Twig_Environment(), $useExt); | ||
193 | |||
194 | $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); | ||
195 | } | ||
196 | |||
197 | /** | ||
198 | * @dataProvider getGetAttributeTests | ||
199 | */ | ||
200 | public function testGetAttributeStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false, $exceptionMessage = null) | ||
201 | { | ||
202 | $template = new Twig_TemplateTest(new Twig_Environment(null, array('strict_variables' => true)), $useExt); | ||
203 | |||
204 | if ($defined) { | ||
205 | $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); | ||
206 | } else { | ||
207 | try { | ||
208 | $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); | ||
209 | |||
210 | throw new Exception('Expected Twig_Error_Runtime exception.'); | ||
211 | } catch (Twig_Error_Runtime $e) { | ||
212 | if (null !== $exceptionMessage) { | ||
213 | $this->assertSame($exceptionMessage, $e->getMessage()); | ||
214 | } | ||
215 | } | ||
216 | } | ||
217 | } | ||
218 | |||
219 | /** | ||
220 | * @dataProvider getGetAttributeTests | ||
221 | */ | ||
222 | public function testGetAttributeDefined($defined, $value, $object, $item, $arguments, $type, $useExt = false) | ||
223 | { | ||
224 | $template = new Twig_TemplateTest(new Twig_Environment(), $useExt); | ||
225 | |||
226 | $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); | ||
227 | } | ||
228 | |||
229 | /** | ||
230 | * @dataProvider getGetAttributeTests | ||
231 | */ | ||
232 | public function testGetAttributeDefinedStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false) | ||
233 | { | ||
234 | $template = new Twig_TemplateTest(new Twig_Environment(null, array('strict_variables' => true)), $useExt); | ||
235 | |||
236 | $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); | ||
237 | } | ||
238 | |||
239 | public function getGetAttributeTests() | ||
240 | { | ||
241 | $array = array( | ||
242 | 'defined' => 'defined', | ||
243 | 'zero' => 0, | ||
244 | 'null' => null, | ||
245 | '1' => 1, | ||
246 | 'bar' => true, | ||
247 | '09' => '09', | ||
248 | '+4' => '+4', | ||
249 | ); | ||
250 | |||
251 | $objectArray = new Twig_TemplateArrayAccessObject(); | ||
252 | $stdObject = (object) $array; | ||
253 | $magicPropertyObject = new Twig_TemplateMagicPropertyObject(); | ||
254 | $propertyObject = new Twig_TemplatePropertyObject(); | ||
255 | $propertyObject1 = new Twig_TemplatePropertyObjectAndIterator(); | ||
256 | $propertyObject2 = new Twig_TemplatePropertyObjectAndArrayAccess(); | ||
257 | $methodObject = new Twig_TemplateMethodObject(); | ||
258 | $magicMethodObject = new Twig_TemplateMagicMethodObject(); | ||
259 | |||
260 | $anyType = Twig_TemplateInterface::ANY_CALL; | ||
261 | $methodType = Twig_TemplateInterface::METHOD_CALL; | ||
262 | $arrayType = Twig_TemplateInterface::ARRAY_CALL; | ||
263 | |||
264 | $basicTests = array( | ||
265 | // array(defined, value, property to fetch) | ||
266 | array(true, 'defined', 'defined'), | ||
267 | array(false, null, 'undefined'), | ||
268 | array(false, null, 'protected'), | ||
269 | array(true, 0, 'zero'), | ||
270 | array(true, 1, 1), | ||
271 | array(true, 1, 1.0), | ||
272 | array(true, null, 'null'), | ||
273 | array(true, true, 'bar'), | ||
274 | array(true, '09', '09'), | ||
275 | array(true, '+4', '+4'), | ||
276 | ); | ||
277 | $testObjects = array( | ||
278 | // array(object, type of fetch) | ||
279 | array($array, $arrayType), | ||
280 | array($objectArray, $arrayType), | ||
281 | array($stdObject, $anyType), | ||
282 | array($magicPropertyObject, $anyType), | ||
283 | array($methodObject, $methodType), | ||
284 | array($methodObject, $anyType), | ||
285 | array($propertyObject, $anyType), | ||
286 | array($propertyObject1, $anyType), | ||
287 | array($propertyObject2, $anyType), | ||
288 | ); | ||
289 | |||
290 | $tests = array(); | ||
291 | foreach ($testObjects as $testObject) { | ||
292 | foreach ($basicTests as $test) { | ||
293 | // properties cannot be numbers | ||
294 | if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) { | ||
295 | continue; | ||
296 | } | ||
297 | |||
298 | if ('+4' === $test[2] && $methodObject === $testObject[0]) { | ||
299 | continue; | ||
300 | } | ||
301 | |||
302 | $tests[] = array($test[0], $test[1], $testObject[0], $test[2], array(), $testObject[1]); | ||
303 | } | ||
304 | } | ||
305 | |||
306 | // additional method tests | ||
307 | $tests = array_merge($tests, array( | ||
308 | array(true, 'defined', $methodObject, 'defined', array(), $methodType), | ||
309 | array(true, 'defined', $methodObject, 'DEFINED', array(), $methodType), | ||
310 | array(true, 'defined', $methodObject, 'getDefined', array(), $methodType), | ||
311 | array(true, 'defined', $methodObject, 'GETDEFINED', array(), $methodType), | ||
312 | array(true, 'static', $methodObject, 'static', array(), $methodType), | ||
313 | array(true, 'static', $methodObject, 'getStatic', array(), $methodType), | ||
314 | |||
315 | array(true, '__call_undefined', $magicMethodObject, 'undefined', array(), $methodType), | ||
316 | array(true, '__call_UNDEFINED', $magicMethodObject, 'UNDEFINED', array(), $methodType), | ||
317 | )); | ||
318 | |||
319 | // add the same tests for the any type | ||
320 | foreach ($tests as $test) { | ||
321 | if ($anyType !== $test[5]) { | ||
322 | $test[5] = $anyType; | ||
323 | $tests[] = $test; | ||
324 | } | ||
325 | } | ||
326 | |||
327 | $methodAndPropObject = new Twig_TemplateMethodAndPropObject; | ||
328 | |||
329 | // additional method tests | ||
330 | $tests = array_merge($tests, array( | ||
331 | array(true, 'a', $methodAndPropObject, 'a', array(), $anyType), | ||
332 | array(true, 'a', $methodAndPropObject, 'a', array(), $methodType), | ||
333 | array(false, null, $methodAndPropObject, 'a', array(), $arrayType), | ||
334 | |||
335 | array(true, 'b_prop', $methodAndPropObject, 'b', array(), $anyType), | ||
336 | array(true, 'b', $methodAndPropObject, 'B', array(), $anyType), | ||
337 | array(true, 'b', $methodAndPropObject, 'b', array(), $methodType), | ||
338 | array(true, 'b', $methodAndPropObject, 'B', array(), $methodType), | ||
339 | array(false, null, $methodAndPropObject, 'b', array(), $arrayType), | ||
340 | |||
341 | array(false, null, $methodAndPropObject, 'c', array(), $anyType), | ||
342 | array(false, null, $methodAndPropObject, 'c', array(), $methodType), | ||
343 | array(false, null, $methodAndPropObject, 'c', array(), $arrayType), | ||
344 | |||
345 | )); | ||
346 | |||
347 | // tests when input is not an array or object | ||
348 | $tests = array_merge($tests, array( | ||
349 | array(false, null, 42, 'a', array(), $anyType, false, 'Impossible to access an attribute ("a") on a integer variable ("42")'), | ||
350 | array(false, null, "string", 'a', array(), $anyType, false, 'Impossible to access an attribute ("a") on a string variable ("string")'), | ||
351 | array(false, null, array(), 'a', array(), $anyType, false, 'Key "a" for array with keys "" does not exist'), | ||
352 | )); | ||
353 | |||
354 | // add twig_template_get_attributes tests | ||
355 | |||
356 | if (function_exists('twig_template_get_attributes')) { | ||
357 | foreach (array_slice($tests, 0) as $test) { | ||
358 | $test = array_pad($test, 7, null); | ||
359 | $test[6] = true; | ||
360 | $tests[] = $test; | ||
361 | } | ||
362 | } | ||
363 | |||
364 | return $tests; | ||
365 | } | ||
366 | } | ||
367 | |||
368 | class Twig_TemplateTest extends Twig_Template | ||
369 | { | ||
370 | protected $useExtGetAttribute = false; | ||
371 | |||
372 | public function __construct(Twig_Environment $env, $useExtGetAttribute = false) | ||
373 | { | ||
374 | parent::__construct($env); | ||
375 | $this->useExtGetAttribute = $useExtGetAttribute; | ||
376 | Twig_Template::clearCache(); | ||
377 | } | ||
378 | |||
379 | public function getZero() | ||
380 | { | ||
381 | return 0; | ||
382 | } | ||
383 | |||
384 | public function getEmpty() | ||
385 | { | ||
386 | return ''; | ||
387 | } | ||
388 | |||
389 | public function getString() | ||
390 | { | ||
391 | return 'some_string'; | ||
392 | } | ||
393 | |||
394 | public function getTrue() | ||
395 | { | ||
396 | return true; | ||
397 | } | ||
398 | |||
399 | public function getTemplateName() | ||
400 | { | ||
401 | } | ||
402 | |||
403 | public function getDebugInfo() | ||
404 | { | ||
405 | return array(); | ||
406 | } | ||
407 | |||
408 | protected function doGetParent(array $context) | ||
409 | { | ||
410 | } | ||
411 | |||
412 | protected function doDisplay(array $context, array $blocks = array()) | ||
413 | { | ||
414 | } | ||
415 | |||
416 | public function getAttribute($object, $item, array $arguments = array(), $type = Twig_TemplateInterface::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) | ||
417 | { | ||
418 | if ($this->useExtGetAttribute) { | ||
419 | return twig_template_get_attributes($this, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); | ||
420 | } else { | ||
421 | return parent::getAttribute($object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); | ||
422 | } | ||
423 | } | ||
424 | } | ||
425 | |||
426 | class Twig_TemplateArrayAccessObject implements ArrayAccess | ||
427 | { | ||
428 | protected $protected = 'protected'; | ||
429 | |||
430 | public $attributes = array( | ||
431 | 'defined' => 'defined', | ||
432 | 'zero' => 0, | ||
433 | 'null' => null, | ||
434 | '1' => 1, | ||
435 | 'bar' => true, | ||
436 | '09' => '09', | ||
437 | '+4' => '+4', | ||
438 | ); | ||
439 | |||
440 | public function offsetExists($name) | ||
441 | { | ||
442 | return array_key_exists($name, $this->attributes); | ||
443 | } | ||
444 | |||
445 | public function offsetGet($name) | ||
446 | { | ||
447 | return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; | ||
448 | } | ||
449 | |||
450 | public function offsetSet($name, $value) | ||
451 | { | ||
452 | } | ||
453 | |||
454 | public function offsetUnset($name) | ||
455 | { | ||
456 | } | ||
457 | } | ||
458 | |||
459 | class Twig_TemplateMagicPropertyObject | ||
460 | { | ||
461 | public $defined = 'defined'; | ||
462 | |||
463 | public $attributes = array( | ||
464 | 'zero' => 0, | ||
465 | 'null' => null, | ||
466 | '1' => 1, | ||
467 | 'bar' => true, | ||
468 | '09' => '09', | ||
469 | '+4' => '+4', | ||
470 | ); | ||
471 | |||
472 | protected $protected = 'protected'; | ||
473 | |||
474 | public function __isset($name) | ||
475 | { | ||
476 | return array_key_exists($name, $this->attributes); | ||
477 | } | ||
478 | |||
479 | public function __get($name) | ||
480 | { | ||
481 | return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; | ||
482 | } | ||
483 | } | ||
484 | |||
485 | class Twig_TemplateMagicPropertyObjectWithException | ||
486 | { | ||
487 | public function __isset($key) | ||
488 | { | ||
489 | throw new Exception("Hey! Don't try to isset me!"); | ||
490 | } | ||
491 | } | ||
492 | |||
493 | class Twig_TemplatePropertyObject | ||
494 | { | ||
495 | public $defined = 'defined'; | ||
496 | public $zero = 0; | ||
497 | public $null = null; | ||
498 | public $bar = true; | ||
499 | |||
500 | protected $protected = 'protected'; | ||
501 | } | ||
502 | |||
503 | class Twig_TemplatePropertyObjectAndIterator extends Twig_TemplatePropertyObject implements IteratorAggregate | ||
504 | { | ||
505 | public function getIterator() | ||
506 | { | ||
507 | return new ArrayIterator(array('foo', 'bar')); | ||
508 | } | ||
509 | } | ||
510 | |||
511 | class Twig_TemplatePropertyObjectAndArrayAccess extends Twig_TemplatePropertyObject implements ArrayAccess | ||
512 | { | ||
513 | private $data = array(); | ||
514 | |||
515 | public function offsetExists($offset) | ||
516 | { | ||
517 | return array_key_exists($offset, $this->data); | ||
518 | } | ||
519 | |||
520 | public function offsetGet($offset) | ||
521 | { | ||
522 | return $this->offsetExists($offset) ? $this->data[$offset] : 'n/a'; | ||
523 | } | ||
524 | |||
525 | public function offsetSet($offset, $value) | ||
526 | { | ||
527 | } | ||
528 | |||
529 | public function offsetUnset($offset) | ||
530 | { | ||
531 | } | ||
532 | } | ||
533 | |||
534 | class Twig_TemplateMethodObject | ||
535 | { | ||
536 | public function getDefined() | ||
537 | { | ||
538 | return 'defined'; | ||
539 | } | ||
540 | |||
541 | public function get1() | ||
542 | { | ||
543 | return 1; | ||
544 | } | ||
545 | |||
546 | public function get09() | ||
547 | { | ||
548 | return '09'; | ||
549 | } | ||
550 | |||
551 | public function getZero() | ||
552 | { | ||
553 | return 0; | ||
554 | } | ||
555 | |||
556 | public function getNull() | ||
557 | { | ||
558 | return null; | ||
559 | } | ||
560 | |||
561 | public function isBar() | ||
562 | { | ||
563 | return true; | ||
564 | } | ||
565 | |||
566 | protected function getProtected() | ||
567 | { | ||
568 | return 'protected'; | ||
569 | } | ||
570 | |||
571 | public static function getStatic() | ||
572 | { | ||
573 | return 'static'; | ||
574 | } | ||
575 | } | ||
576 | |||
577 | class Twig_TemplateMethodAndPropObject | ||
578 | { | ||
579 | private $a = 'a_prop'; | ||
580 | public function getA() | ||
581 | { | ||
582 | return 'a'; | ||
583 | } | ||
584 | |||
585 | public $b = 'b_prop'; | ||
586 | public function getB() | ||
587 | { | ||
588 | return 'b'; | ||
589 | } | ||
590 | |||
591 | private $c = 'c_prop'; | ||
592 | private function getC() | ||
593 | { | ||
594 | return 'c'; | ||
595 | } | ||
596 | } | ||
597 | |||
598 | class Twig_TemplateMagicMethodObject | ||
599 | { | ||
600 | public function __call($method, $arguments) | ||
601 | { | ||
602 | return '__call_'.$method; | ||
603 | } | ||
604 | } | ||
605 | |||
606 | class CExtDisablingNodeVisitor implements Twig_NodeVisitorInterface | ||
607 | { | ||
608 | public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) | ||
609 | { | ||
610 | if ($node instanceof Twig_Node_Expression_GetAttr) { | ||
611 | $node->setAttribute('disable_c_ext', true); | ||
612 | } | ||
613 | |||
614 | return $node; | ||
615 | } | ||
616 | |||
617 | public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) | ||
618 | { | ||
619 | return $node; | ||
620 | } | ||
621 | |||
622 | public function getPriority() | ||
623 | { | ||
624 | return 0; | ||
625 | } | ||
626 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php b/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php deleted file mode 100644 index fd4ec633..00000000 --- a/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of Twig. | ||
5 | * | ||
6 | * (c) Fabien Potencier | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | class Twig_Tests_TokenStreamTest extends PHPUnit_Framework_TestCase | ||
13 | { | ||
14 | protected static $tokens; | ||
15 | |||
16 | public function setUp() | ||
17 | { | ||
18 | self::$tokens = array( | ||
19 | new Twig_Token(Twig_Token::TEXT_TYPE, 1, 1), | ||
20 | new Twig_Token(Twig_Token::TEXT_TYPE, 2, 1), | ||
21 | new Twig_Token(Twig_Token::TEXT_TYPE, 3, 1), | ||
22 | new Twig_Token(Twig_Token::TEXT_TYPE, 4, 1), | ||
23 | new Twig_Token(Twig_Token::TEXT_TYPE, 5, 1), | ||
24 | new Twig_Token(Twig_Token::TEXT_TYPE, 6, 1), | ||
25 | new Twig_Token(Twig_Token::TEXT_TYPE, 7, 1), | ||
26 | new Twig_Token(Twig_Token::EOF_TYPE, 0, 1), | ||
27 | ); | ||
28 | } | ||
29 | |||
30 | public function testNext() | ||
31 | { | ||
32 | $stream = new Twig_TokenStream(self::$tokens); | ||
33 | $repr = array(); | ||
34 | while (!$stream->isEOF()) { | ||
35 | $token = $stream->next(); | ||
36 | |||
37 | $repr[] = $token->getValue(); | ||
38 | } | ||
39 | $this->assertEquals('1, 2, 3, 4, 5, 6, 7', implode(', ', $repr), '->next() advances the pointer and returns the current token'); | ||
40 | } | ||
41 | |||
42 | /** | ||
43 | * @expectedException Twig_Error_Syntax | ||
44 | * @expectedMessage Unexpected end of template | ||
45 | */ | ||
46 | public function testEndOfTemplateNext() | ||
47 | { | ||
48 | $stream = new Twig_TokenStream(array( | ||
49 | new Twig_Token(Twig_Token::BLOCK_START_TYPE, 1, 1), | ||
50 | )); | ||
51 | while (!$stream->isEOF()) { | ||
52 | $stream->next(); | ||
53 | } | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * @expectedException Twig_Error_Syntax | ||
58 | * @expectedMessage Unexpected end of template | ||
59 | */ | ||
60 | public function testEndOfTemplateLook() | ||
61 | { | ||
62 | $stream = new Twig_TokenStream(array( | ||
63 | new Twig_Token(Twig_Token::BLOCK_START_TYPE, 1, 1), | ||
64 | )); | ||
65 | while (!$stream->isEOF()) { | ||
66 | $stream->look(); | ||
67 | $stream->next(); | ||
68 | } | ||
69 | } | ||
70 | } | ||
diff --git a/vendor/twig/twig/test/Twig/Tests/escapingTest.php b/vendor/twig/twig/test/Twig/Tests/escapingTest.php deleted file mode 100644 index b41b5f97..00000000 --- a/vendor/twig/twig/test/Twig/Tests/escapingTest.php +++ /dev/null | |||
@@ -1,320 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * This class is adapted from code coming from Zend Framework. | ||
5 | * | ||
6 | * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
7 | * @license http://framework.zend.com/license/new-bsd New BSD License | ||
8 | */ | ||
9 | |||
10 | class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase | ||
11 | { | ||
12 | /** | ||
13 | * All character encodings supported by htmlspecialchars() | ||
14 | */ | ||
15 | protected $htmlSpecialChars = array( | ||
16 | '\'' => ''', | ||
17 | '"' => '"', | ||
18 | '<' => '<', | ||
19 | '>' => '>', | ||
20 | '&' => '&' | ||
21 | ); | ||
22 | |||
23 | protected $htmlAttrSpecialChars = array( | ||
24 | '\'' => ''', | ||
25 | /* Characters beyond ASCII value 255 to unicode escape */ | ||
26 | 'Ā' => 'Ā', | ||
27 | /* Immune chars excluded */ | ||
28 | ',' => ',', | ||
29 | '.' => '.', | ||
30 | '-' => '-', | ||
31 | '_' => '_', | ||
32 | /* Basic alnums excluded */ | ||
33 | 'a' => 'a', | ||
34 | 'A' => 'A', | ||
35 | 'z' => 'z', | ||
36 | 'Z' => 'Z', | ||
37 | '0' => '0', | ||
38 | '9' => '9', | ||
39 | /* Basic control characters and null */ | ||
40 | "\r" => '
', | ||
41 | "\n" => '
', | ||
42 | "\t" => '	', | ||
43 | "\0" => '�', // should use Unicode replacement char | ||
44 | /* Encode chars as named entities where possible */ | ||
45 | '<' => '<', | ||
46 | '>' => '>', | ||
47 | '&' => '&', | ||
48 | '"' => '"', | ||
49 | /* Encode spaces for quoteless attribute protection */ | ||
50 | ' ' => ' ', | ||
51 | ); | ||
52 | |||
53 | protected $jsSpecialChars = array( | ||
54 | /* HTML special chars - escape without exception to hex */ | ||
55 | '<' => '\\x3C', | ||
56 | '>' => '\\x3E', | ||
57 | '\'' => '\\x27', | ||
58 | '"' => '\\x22', | ||
59 | '&' => '\\x26', | ||
60 | /* Characters beyond ASCII value 255 to unicode escape */ | ||
61 | 'Ā' => '\\u0100', | ||
62 | /* Immune chars excluded */ | ||
63 | ',' => ',', | ||
64 | '.' => '.', | ||
65 | '_' => '_', | ||
66 | /* Basic alnums excluded */ | ||
67 | 'a' => 'a', | ||
68 | 'A' => 'A', | ||
69 | 'z' => 'z', | ||
70 | 'Z' => 'Z', | ||
71 | '0' => '0', | ||
72 | '9' => '9', | ||
73 | /* Basic control characters and null */ | ||
74 | "\r" => '\\x0D', | ||
75 | "\n" => '\\x0A', | ||
76 | "\t" => '\\x09', | ||
77 | "\0" => '\\x00', | ||
78 | /* Encode spaces for quoteless attribute protection */ | ||
79 | ' ' => '\\x20', | ||
80 | ); | ||
81 | |||
82 | protected $urlSpecialChars = array( | ||
83 | /* HTML special chars - escape without exception to percent encoding */ | ||
84 | '<' => '%3C', | ||
85 | '>' => '%3E', | ||
86 | '\'' => '%27', | ||
87 | '"' => '%22', | ||
88 | '&' => '%26', | ||
89 | /* Characters beyond ASCII value 255 to hex sequence */ | ||
90 | 'Ā' => '%C4%80', | ||
91 | /* Punctuation and unreserved check */ | ||
92 | ',' => '%2C', | ||
93 | '.' => '.', | ||
94 | '_' => '_', | ||
95 | '-' => '-', | ||
96 | ':' => '%3A', | ||
97 | ';' => '%3B', | ||
98 | '!' => '%21', | ||
99 | /* Basic alnums excluded */ | ||
100 | 'a' => 'a', | ||
101 | 'A' => 'A', | ||
102 | 'z' => 'z', | ||
103 | 'Z' => 'Z', | ||
104 | '0' => '0', | ||
105 | '9' => '9', | ||
106 | /* Basic control characters and null */ | ||
107 | "\r" => '%0D', | ||
108 | "\n" => '%0A', | ||
109 | "\t" => '%09', | ||
110 | "\0" => '%00', | ||
111 | /* PHP quirks from the past */ | ||
112 | ' ' => '%20', | ||
113 | '~' => '~', | ||
114 | '+' => '%2B', | ||
115 | ); | ||
116 | |||
117 | protected $cssSpecialChars = array( | ||
118 | /* HTML special chars - escape without exception to hex */ | ||
119 | '<' => '\\3C ', | ||
120 | '>' => '\\3E ', | ||
121 | '\'' => '\\27 ', | ||
122 | '"' => '\\22 ', | ||
123 | '&' => '\\26 ', | ||
124 | /* Characters beyond ASCII value 255 to unicode escape */ | ||
125 | 'Ā' => '\\100 ', | ||
126 | /* Immune chars excluded */ | ||
127 | ',' => '\\2C ', | ||
128 | '.' => '\\2E ', | ||
129 | '_' => '\\5F ', | ||
130 | /* Basic alnums excluded */ | ||
131 | 'a' => 'a', | ||
132 | 'A' => 'A', | ||
133 | 'z' => 'z', | ||
134 | 'Z' => 'Z', | ||
135 | '0' => '0', | ||
136 | '9' => '9', | ||
137 | /* Basic control characters and null */ | ||
138 | "\r" => '\\D ', | ||
139 | "\n" => '\\A ', | ||
140 | "\t" => '\\9 ', | ||
141 | "\0" => '\\0 ', | ||
142 | /* Encode spaces for quoteless attribute protection */ | ||
143 | ' ' => '\\20 ', | ||
144 | ); | ||
145 | |||
146 | protected $env; | ||
147 | |||
148 | public function setUp() | ||
149 | { | ||
150 | $this->env = new Twig_Environment(); | ||
151 | } | ||
152 | |||
153 | public function testHtmlEscapingConvertsSpecialChars() | ||
154 | { | ||
155 | foreach ($this->htmlSpecialChars as $key => $value) { | ||
156 | $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html'), 'Failed to escape: '.$key); | ||
157 | } | ||
158 | } | ||
159 | |||
160 | public function testHtmlAttributeEscapingConvertsSpecialChars() | ||
161 | { | ||
162 | foreach ($this->htmlAttrSpecialChars as $key => $value) { | ||
163 | $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html_attr'), 'Failed to escape: '.$key); | ||
164 | } | ||
165 | } | ||
166 | |||
167 | public function testJavascriptEscapingConvertsSpecialChars() | ||
168 | { | ||
169 | foreach ($this->jsSpecialChars as $key => $value) { | ||
170 | $this->assertEquals($value, twig_escape_filter($this->env, $key, 'js'), 'Failed to escape: '.$key); | ||
171 | } | ||
172 | } | ||
173 | |||
174 | public function testJavascriptEscapingReturnsStringIfZeroLength() | ||
175 | { | ||
176 | $this->assertEquals('', twig_escape_filter($this->env, '', 'js')); | ||
177 | } | ||
178 | |||
179 | public function testJavascriptEscapingReturnsStringIfContainsOnlyDigits() | ||
180 | { | ||
181 | $this->assertEquals('123', twig_escape_filter($this->env, '123', 'js')); | ||
182 | } | ||
183 | |||
184 | public function testCssEscapingConvertsSpecialChars() | ||
185 | { | ||
186 | foreach ($this->cssSpecialChars as $key => $value) { | ||
187 | $this->assertEquals($value, twig_escape_filter($this->env, $key, 'css'), 'Failed to escape: '.$key); | ||
188 | } | ||
189 | } | ||
190 | |||
191 | public function testCssEscapingReturnsStringIfZeroLength() | ||
192 | { | ||
193 | $this->assertEquals('', twig_escape_filter($this->env, '', 'css')); | ||
194 | } | ||
195 | |||
196 | public function testCssEscapingReturnsStringIfContainsOnlyDigits() | ||
197 | { | ||
198 | $this->assertEquals('123', twig_escape_filter($this->env, '123', 'css')); | ||
199 | } | ||
200 | |||
201 | public function testUrlEscapingConvertsSpecialChars() | ||
202 | { | ||
203 | foreach ($this->urlSpecialChars as $key => $value) { | ||
204 | $this->assertEquals($value, twig_escape_filter($this->env, $key, 'url'), 'Failed to escape: '.$key); | ||
205 | } | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * Range tests to confirm escaped range of characters is within OWASP recommendation | ||
210 | */ | ||
211 | |||
212 | /** | ||
213 | * Only testing the first few 2 ranges on this prot. function as that's all these | ||
214 | * other range tests require | ||
215 | */ | ||
216 | public function testUnicodeCodepointConversionToUtf8() | ||
217 | { | ||
218 | $expected = " ~ޙ"; | ||
219 | $codepoints = array(0x20, 0x7e, 0x799); | ||
220 | $result = ''; | ||
221 | foreach ($codepoints as $value) { | ||
222 | $result .= $this->codepointToUtf8($value); | ||
223 | } | ||
224 | $this->assertEquals($expected, $result); | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * Convert a Unicode Codepoint to a literal UTF-8 character. | ||
229 | * | ||
230 | * @param int Unicode codepoint in hex notation | ||
231 | * @return string UTF-8 literal string | ||
232 | */ | ||
233 | protected function codepointToUtf8($codepoint) | ||
234 | { | ||
235 | if ($codepoint < 0x80) { | ||
236 | return chr($codepoint); | ||
237 | } | ||
238 | if ($codepoint < 0x800) { | ||
239 | return chr($codepoint >> 6 & 0x3f | 0xc0) | ||
240 | . chr($codepoint & 0x3f | 0x80); | ||
241 | } | ||
242 | if ($codepoint < 0x10000) { | ||
243 | return chr($codepoint >> 12 & 0x0f | 0xe0) | ||
244 | . chr($codepoint >> 6 & 0x3f | 0x80) | ||
245 | . chr($codepoint & 0x3f | 0x80); | ||
246 | } | ||
247 | if ($codepoint < 0x110000) { | ||
248 | return chr($codepoint >> 18 & 0x07 | 0xf0) | ||
249 | . chr($codepoint >> 12 & 0x3f | 0x80) | ||
250 | . chr($codepoint >> 6 & 0x3f | 0x80) | ||
251 | . chr($codepoint & 0x3f | 0x80); | ||
252 | } | ||
253 | throw new Exception('Codepoint requested outside of Unicode range'); | ||
254 | } | ||
255 | |||
256 | public function testJavascriptEscapingEscapesOwaspRecommendedRanges() | ||
257 | { | ||
258 | $immune = array(',', '.', '_'); // Exceptions to escaping ranges | ||
259 | for ($chr=0; $chr < 0xFF; $chr++) { | ||
260 | if ($chr >= 0x30 && $chr <= 0x39 | ||
261 | || $chr >= 0x41 && $chr <= 0x5A | ||
262 | || $chr >= 0x61 && $chr <= 0x7A) { | ||
263 | $literal = $this->codepointToUtf8($chr); | ||
264 | $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js')); | ||
265 | } else { | ||
266 | $literal = $this->codepointToUtf8($chr); | ||
267 | if (in_array($literal, $immune)) { | ||
268 | $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js')); | ||
269 | } else { | ||
270 | $this->assertNotEquals( | ||
271 | $literal, | ||
272 | twig_escape_filter($this->env, $literal, 'js'), | ||
273 | "$literal should be escaped!"); | ||
274 | } | ||
275 | } | ||
276 | } | ||
277 | } | ||
278 | |||
279 | public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges() | ||
280 | { | ||
281 | $immune = array(',', '.', '-', '_'); // Exceptions to escaping ranges | ||
282 | for ($chr=0; $chr < 0xFF; $chr++) { | ||
283 | if ($chr >= 0x30 && $chr <= 0x39 | ||
284 | || $chr >= 0x41 && $chr <= 0x5A | ||
285 | || $chr >= 0x61 && $chr <= 0x7A) { | ||
286 | $literal = $this->codepointToUtf8($chr); | ||
287 | $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr')); | ||
288 | } else { | ||
289 | $literal = $this->codepointToUtf8($chr); | ||
290 | if (in_array($literal, $immune)) { | ||
291 | $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr')); | ||
292 | } else { | ||
293 | $this->assertNotEquals( | ||
294 | $literal, | ||
295 | twig_escape_filter($this->env, $literal, 'html_attr'), | ||
296 | "$literal should be escaped!"); | ||
297 | } | ||
298 | } | ||
299 | } | ||
300 | } | ||
301 | |||
302 | public function testCssEscapingEscapesOwaspRecommendedRanges() | ||
303 | { | ||
304 | $immune = array(); // CSS has no exceptions to escaping ranges | ||
305 | for ($chr=0; $chr < 0xFF; $chr++) { | ||
306 | if ($chr >= 0x30 && $chr <= 0x39 | ||
307 | || $chr >= 0x41 && $chr <= 0x5A | ||
308 | || $chr >= 0x61 && $chr <= 0x7A) { | ||
309 | $literal = $this->codepointToUtf8($chr); | ||
310 | $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'css')); | ||
311 | } else { | ||
312 | $literal = $this->codepointToUtf8($chr); | ||
313 | $this->assertNotEquals( | ||
314 | $literal, | ||
315 | twig_escape_filter($this->env, $literal, 'css'), | ||
316 | "$literal should be escaped!"); | ||
317 | } | ||
318 | } | ||
319 | } | ||
320 | } | ||