Completed
Push — 1.0-taxons-list-bug ( 82a516 )
by Kamil
51:38 queued 23:12
created

ZoneMemberSpec::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\ZoneInterface;
18
use Sylius\Component\Addressing\Model\ZoneMember;
19
use Sylius\Component\Addressing\Model\ZoneMemberInterface;
20
21
/**
22
 * @author Saša Stamenković <[email protected]>
23
 * @author Jan Góralski <[email protected]>
24
 */
25
final class ZoneMemberSpec extends ObjectBehavior
26
{
27
    function it_is_initializable(): void
28
    {
29
        $this->shouldHaveType(ZoneMember::class);
30
    }
31
32
    function it_implements_zone_member_interface(): void
33
    {
34
        $this->shouldImplement(ZoneMemberInterface::class);
35
    }
36
37
    function it_has_no_id_by_default(): void
38
    {
39
        $this->getId()->shouldReturn(null);
40
    }
41
42
    function it_has_no_code_by_default(): void
43
    {
44
        $this->getCode()->shouldReturn(null);
45
    }
46
47
    function its_code_is_mutable(): void
48
    {
49
        $this->setCode('IE');
50
        $this->getCode()->shouldReturn('IE');
51
    }
52
53
    function it_doesnt_belong_to_any_zone_by_default(): void
54
    {
55
        $this->getBelongsTo()->shouldReturn(null);
56
    }
57
58
    function it_can_belong_to_a_zone(ZoneInterface $zone): void
59
    {
60
        $this->setBelongsTo($zone);
61
        $this->getBelongsTo()->shouldReturn($zone);
62
    }
63
}
64