Completed
Push — scalar-types/resource ( 4814fd )
by Kamil
23:02
created

LocaleHelperSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
cc 1
eloc 2
nop 1
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
declare(strict_types=1);
13
14
namespace spec\Sylius\Bundle\LocaleBundle\Templating\Helper;
15
16
use PhpSpec\ObjectBehavior;
17
use Sylius\Bundle\LocaleBundle\Templating\Helper\LocaleHelper;
18
use Sylius\Bundle\LocaleBundle\Templating\Helper\LocaleHelperInterface;
19
use Sylius\Component\Locale\Context\LocaleContextInterface;
20
use Sylius\Component\Locale\Converter\LocaleConverterInterface;
21
use Symfony\Component\Templating\Helper\Helper;
22
23
/**
24
 * @author Arnaud Langlade <[email protected]>
25
 */
26
final class LocaleHelperSpec extends ObjectBehavior
27
{
28
    function let(LocaleConverterInterface $localeConverter): void
29
    {
30
        $this->beConstructedWith($localeConverter);
31
    }
32
33
    function it_is_a_helper(): void
34
    {
35
        $this->shouldHaveType(Helper::class);
36
    }
37
38
    function it_is_a_locale_helper(): void
39
    {
40
        $this->shouldImplement(LocaleHelperInterface::class);
41
    }
42
43
    function it_converts_locales_code_to_name(LocaleConverterInterface $localeConverter): void
44
    {
45
        $localeConverter->convertCodeToName('fr_FR')->willReturn('French (France)');
46
47
        $this->convertCodeToName('fr_FR')->shouldReturn('French (France)');
48
    }
49
50
    function it_has_a_name(): void
51
    {
52
        $this->getName()->shouldReturn('sylius_locale');
53
    }
54
}
55