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

ProvinceNamingExtensionSpec   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 4 1
A it_is_a_twig_extension() 0 4 1
A it_gets_province_name_by_its_code() 0 6 1
A it_gets_province_abbreviation_by_its_code() 0 6 1
A it_has_name() 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
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