Security update to Drupal 8.4.6
[yaffs-website] / vendor / twig / twig / test / Twig / Tests / LegacyIntegrationTest.php
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_LegacyIntegrationTest extends Twig_Test_IntegrationTestCase
13 {
14     public function getExtensions()
15     {
16         return array(
17             new LegacyTwigTestExtension(),
18         );
19     }
20
21     public function getFixturesDir()
22     {
23         return dirname(__FILE__).'/LegacyFixtures/';
24     }
25
26     public function getTests($name, $legacyTests = false)
27     {
28         if (!$legacyTests) {
29             return array(array('', '', '', array(), '', array()));
30         }
31
32         return parent::getTests($name, true);
33     }
34 }
35
36 class LegacyTwigTestExtension extends Twig_Extension
37 {
38     public function getTests()
39     {
40         return array(
41             'multi word' => new Twig_Test_Method($this, 'is_multi_word'),
42         );
43     }
44
45     public function is_multi_word($value)
46     {
47         return false !== strpos($value, ' ');
48     }
49
50     public function getName()
51     {
52         return 'legacy_integration_test';
53     }
54 }