Completed
Push — master ( d998d0...abb41b )
by Kamil
38:34
created

ProvinceNamingExtensionSpec::it_has_name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
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 spec\Sylius\Bundle\AddressingBundle\Twig;
13
14
use PhpSpec\ObjectBehavior;
15
use Sylius\Component\Addressing\Provider\ProvinceNamingProviderInterface;
16
17
/**
18
 * @author Jan Góralski <[email protected]>
19
 */
20
class ProvinceNamingExtensionSpec extends ObjectBehavior
21
{
22
    function let(ProvinceNamingProviderInterface $provinceNamingProvider)
23
    {
24
        $this->beConstructedWith($provinceNamingProvider);
25
    }
26
27
    function it_is_initializable()
28
    {
29
        $this->shouldHaveType('Sylius\Bundle\AddressingBundle\Twig\ProvinceNamingExtension');
30
    }
31
32
    function it_is_a_twig_extension()
33
    {
34
        $this->shouldHaveType('Twig_Extension');
35
    }
36
37
    function it_gets_province_name_by_its_code(ProvinceNamingProviderInterface $provinceNamingProvider)
38
    {
39
        $provinceNamingProvider->getName('IE-UL')->willReturn('Ulster');
40
41
        $this->getProvinceName('IE-UL')->shouldReturn('Ulster');
42
    }
43
44
    function it_gets_province_abbreviation_by_its_code(ProvinceNamingProviderInterface $provinceNamingProvider)
45
    {
46
        $provinceNamingProvider->getAbbreviation('IE-UL')->willReturn('ULS');
47
48
        $this->getProvinceAbbreviation('IE-UL')->shouldReturn('ULS');
49
    }
50
51
    function it_has_name()
52
    {
53
        $this->getName()->shouldReturn('sylius_province_naming');
54
    }
55
}
56