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

LocaleHelperSpec   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 29
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_a_locale_helper() 0 4 1
A it_converts_locales_code_to_name() 0 6 1
A it_has_a_name() 0 4 1
A it_is_a_helper() 0 4 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