Completed
Push — 1.0.5 ( 17d4f3 )
by Kamil
27:12
created

ProvinceSpec::it_has_no_code_by_default()   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 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
declare(strict_types=1);
13
14
namespace spec\Sylius\Component\Addressing\Model;
15
16
use PhpSpec\ObjectBehavior;
17
use Sylius\Component\Addressing\Model\CountryInterface;
18
use Sylius\Component\Addressing\Model\Province;
19
use Sylius\Component\Addressing\Model\ProvinceInterface;
20
use Sylius\Component\Resource\Model\CodeAwareInterface;
21
22
final class ProvinceSpec extends ObjectBehavior
23
{
24
    function it_is_initializable(): void
25
    {
26
        $this->shouldHaveType(Province::class);
27
    }
28
29
    function it_implements_Sylius_country_province_interface(): void
0 ignored issues
show
Coding Style introduced by
function it_implements_S...ry_province_interface() does not seem to conform to the naming convention (^(?:(?:[a-z]|__)[a-zA-Z0-9]*|[a-z][a-z0-9_]*)$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
30
    {
31
        $this->shouldImplement(ProvinceInterface::class);
32
    }
33
34
    function it_implements_code_aware_interface(): void
35
    {
36
        $this->shouldImplement(CodeAwareInterface::class);
37
    }
38
39
    function it_has_no_id_by_default(): void
40
    {
41
        $this->getId()->shouldReturn(null);
42
    }
43
44
    function it_has_no_code_by_default(): void
45
    {
46
        $this->getCode()->shouldReturn(null);
47
    }
48
49
    function its_code_is_mutable(): void
50
    {
51
        $this->setCode('US-TX');
52
        $this->getCode()->shouldReturn('US-TX');
53
    }
54
55
    function it_has_no_name_by_default(): void
56
    {
57
        $this->getName()->shouldReturn(null);
58
    }
59
60
    function its_name_is_mutable(): void
61
    {
62
        $this->setName('Texas');
63
        $this->getName()->shouldReturn('Texas');
64
    }
65
66
    function it_has_no_abbreviation_by_default(): void
67
    {
68
        $this->getAbbreviation()->shouldReturn(null);
69
    }
70
71
    function its_abbreviation_is_mutable(): void
72
    {
73
        $this->setAbbreviation('TEX');
74
        $this->getAbbreviation()->shouldReturn('TEX');
75
    }
76
77
    function it_does_not_belong_to_country_by_default(): void
78
    {
79
        $this->getCountry()->shouldReturn(null);
80
    }
81
82
    function it_allows_to_attach_itself_to_a_country(CountryInterface $country): void
83
    {
84
        $this->setCountry($country);
85
        $this->getCountry()->shouldReturn($country);
86
    }
87
}
88