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
12use Twig\Extension\AbstractExtension;
13use Twig\Test\IntegrationTestCase;
14
15class Twig_Tests_LegacyIntegrationTest extends IntegrationTestCase
16{
17    public function getExtensions()
18    {
19        return [
20            new LegacyTwigTestExtension(),
21        ];
22    }
23
24    public function getFixturesDir()
25    {
26        return __DIR__.'/LegacyFixtures/';
27    }
28
29    public function getTests($name, $legacyTests = false)
30    {
31        if (!$legacyTests) {
32            return [['', '', '', [], '', []]];
33        }
34
35        return parent::getTests($name, true);
36    }
37}
38
39class LegacyTwigTestExtension extends AbstractExtension
40{
41    public function getTests()
42    {
43        return [
44            'multi word' => new Twig_Test_Method($this, 'is_multi_word'),
45        ];
46    }
47
48    public function is_multi_word($value)
49    {
50        return false !== strpos($value, ' ');
51    }
52
53    public function getName()
54    {
55        return 'legacy_integration_test';
56    }
57}
58