Completed
Push — scalar-types/currency ( d4a290...08e1db )
by Kamil
25:05 queued 02:52
created

ChannelSpec::it_is_initializable()   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\Channel\Model;
15
16
use PhpSpec\ObjectBehavior;
17
use Sylius\Component\Channel\Model\ChannelInterface;
18
19
final class ChannelSpec extends ObjectBehavior
20
{
21
    function it_implements_channel_interface(): void
22
    {
23
        $this->shouldImplement(ChannelInterface::class);
24
    }
25
26
    function it_has_no_id_by_default(): void
27
    {
28
        $this->getId()->shouldReturn(null);
29
    }
30
31
    function it_has_no_code_by_default(): void
32
    {
33
        $this->getCode()->shouldReturn(null);
34
    }
35
36
    function its_code_is_mutable(): void
37
    {
38
        $this->setCode('mobile');
39
        $this->getCode()->shouldReturn('mobile');
40
    }
41
42
    function it_is_unnamed_by_default(): void
43
    {
44
        $this->getName()->shouldReturn(null);
45
    }
46
47
    function its_name_is_mutable(): void
48
    {
49
        $this->setName('Mobile Store');
50
        $this->getName()->shouldReturn('Mobile Store');
51
    }
52
53
    function it_has_no_color_by_default(): void
54
    {
55
        $this->getColor()->shouldReturn(null);
56
    }
57
58
    function its_color_is_mutable(): void
59
    {
60
        $this->setColor('#1abb9c');
61
        $this->getColor()->shouldReturn('#1abb9c');
62
    }
63
64
    function it_is_enabled_by_default(): void
65
    {
66
        $this->shouldBeEnabled();
67
    }
68
69
    function it_can_be_disabled(): void
70
    {
71
        $this->setEnabled(false);
72
        $this->shouldNotBeEnabled();
73
    }
74
75
    function it_initializes_creation_date_by_default(): void
76
    {
77
        $this->getCreatedAt()->shouldHaveType(\DateTimeInterface::class);
78
    }
79
80
    function its_creation_date_is_mutable(\DateTime $date): void
81
    {
82
        $this->setCreatedAt($date);
83
        $this->getCreatedAt()->shouldReturn($date);
84
    }
85
86
    function it_has_no_last_update_date_by_default(): void
87
    {
88
        $this->getUpdatedAt()->shouldReturn(null);
89
    }
90
91
    function its_last_update_date_is_mutable(\DateTime $date): void
92
    {
93
        $this->setUpdatedAt($date);
94
        $this->getUpdatedAt()->shouldReturn($date);
95
    }
96
}
97