Completed
Push — component-bundle ( 562cd1...8003e8 )
by Kamil
22:18
created

it_respects_theming_logic_while_translating_messages()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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 Sylius\Bundle\ThemeBundle\Tests\Functional;
13
14
/**
15
 * @author Kamil Kokot <[email protected]>
16
 */
17
final class TranslationTest extends ThemeBundleTestCase
18
{
19
    /**
20
     * @test
21
     */
22
    public function it_respects_theming_logic_while_translating_messages()
23
    {
24
        $client = $this->getClient();
25
26
        $crawler = $client->request('GET', '/template/:Translation:translationsTest.txt.twig');
27
28
        foreach ($this->getTranslationsLines() as $expectedContent) {
29
            $this->assertContains($expectedContent, $crawler->text());
30
        }
31
    }
32
33
    /**
34
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use string[].

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
35
     */
36
    protected function getTranslationsLines()
37
    {
38
        return [
39
            'BUNDLE/Resources/translations: BUNDLE/Resources/translations',
40
            'app/Resources/BUNDLE_NAME/translations: app/Resources/BUNDLE_NAME/translations',
41
            'app/Resources/translations: app/Resources/translations',
42
            'THEME/BUNDLE_NAME/translations: THEME/BUNDLE_NAME/translations',
43
            'THEME/translations: THEME/translations',
44
            'PARENT_THEME/BUNDLE_NAME/translations: PARENT_THEME/BUNDLE_NAME/translations',
45
            'PARENT_THEME/translations: PARENT_THEME/translations',
46
        ];
47
    }
48
}
49