Passed
Push — master ( d2e487...b38026 )
by Tobias
05:31
created

testRemovalWithSimpleTemplate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 7
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 13
rs 10
1
<?php
2
3
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
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 Translation\Bundle\Tests\Unit\Twig;
13
14
use Symfony\Component\HttpKernel\Kernel;
15
16
/**
17
 * @author Johannes M. Schmitt <[email protected]>
18
 */
19
class RemovingNodeVisitorTest extends BaseTwigTestCase
20
{
21
    public function testRemovalWithSimpleTemplate(): void
22
    {
23
        // transchoice tag have been definively removed in sf ^5.0
24
        // Remove this condition & *with_transchoice templates once sf ^5.0 is the minimum supported version.
25
        if (\version_compare(Kernel::VERSION, 5.0, '<')) {
26
            $expected = $this->parse('simple_template_compiled_with_transchoice.html.twig');
27
            $actual = $this->parse('simple_template_with_transchoice.html.twig');
28
        } else {
29
            $expected = $this->parse('simple_template_compiled.html.twig');
30
            $actual = $this->parse('simple_template.html.twig');
31
        }
32
33
        $this->assertEquals($expected, $actual);
34
    }
35
}
36