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

ZoneMemberSpec   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 39
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_implements_zone_member_interface() 0 4 1
A it_has_no_id_by_default() 0 4 1
A it_has_no_code_by_default() 0 4 1
A its_code_is_mutable() 0 5 1
A it_doesnt_belong_to_any_zone_by_default() 0 4 1
A it_can_belong_to_a_zone() 0 5 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\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