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

RemovingNodeVisitorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRemovalWithSimpleTemplate() 0 13 2
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