diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
commit | 46b77928f746a4231d064774b5b67fd892c7ce86 (patch) | |
tree | e3ea690b3f0def1744ddae758923cf92171ef985 /vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php | |
parent | 68abd9c71b1d2f7bb2e9d21819584d1d15005b25 (diff) | |
download | wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.gz wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.zst wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.zip |
rm vendor
Diffstat (limited to 'vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php')
-rw-r--r-- | vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php b/vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php deleted file mode 100644 index 3c5d762c..00000000 --- a/vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
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 | namespace Symfony\Bridge\Twig\Tests\Extension; | ||
13 | |||
14 | use Symfony\Bridge\Twig\Extension\RoutingExtension; | ||
15 | use Symfony\Bridge\Twig\Tests\TestCase; | ||
16 | |||
17 | class RoutingExtensionTest extends TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | parent::setUp(); | ||
22 | |||
23 | if (!class_exists('Symfony\Component\Routing\Route')) { | ||
24 | $this->markTestSkipped('The "Routing" component is not available'); | ||
25 | } | ||
26 | } | ||
27 | |||
28 | /** | ||
29 | * @dataProvider getEscapingTemplates | ||
30 | */ | ||
31 | public function testEscaping($template, $mustBeEscaped) | ||
32 | { | ||
33 | $twig = new \Twig_Environment(null, array('debug' => true, 'cache' => false, 'autoescape' => true, 'optimizations' => 0)); | ||
34 | $twig->addExtension(new RoutingExtension($this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface'))); | ||
35 | |||
36 | $nodes = $twig->parse($twig->tokenize($template)); | ||
37 | |||
38 | $this->assertSame($mustBeEscaped, $nodes->getNode('body')->getNode(0)->getNode('expr') instanceof \Twig_Node_Expression_Filter); | ||
39 | } | ||
40 | |||
41 | public function getEscapingTemplates() | ||
42 | { | ||
43 | return array( | ||
44 | array('{{ path("foo") }}', false), | ||
45 | array('{{ path("foo", {}) }}', false), | ||
46 | array('{{ path("foo", { foo: "foo" }) }}', false), | ||
47 | array('{{ path("foo", foo) }}', true), | ||
48 | array('{{ path("foo", { foo: foo }) }}', true), | ||
49 | array('{{ path("foo", { foo: ["foo", "bar"] }) }}', true), | ||
50 | array('{{ path("foo", { foo: "foo", bar: "bar" }) }}', true), | ||
51 | |||
52 | array('{{ path(name = "foo", parameters = {}) }}', false), | ||
53 | array('{{ path(name = "foo", parameters = { foo: "foo" }) }}', false), | ||
54 | array('{{ path(name = "foo", parameters = foo) }}', true), | ||
55 | array('{{ path(name = "foo", parameters = { foo: ["foo", "bar"] }) }}', true), | ||
56 | array('{{ path(name = "foo", parameters = { foo: foo }) }}', true), | ||
57 | array('{{ path(name = "foo", parameters = { foo: "foo", bar: "bar" }) }}', true), | ||
58 | ); | ||
59 | } | ||
60 | } | ||