Passed
Branch master (e8fd46)
by Alexey
02:50
created

PayloadSpec   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 1
1
<?php
2
3
namespace spec\Venta\Adr;
4
5
use PhpSpec\ObjectBehavior;
6
7
class PayloadSpec extends ObjectBehavior
8
{
9
    function let()
10
    {
11
        $this->beConstructedWith('status');
12
    }
13
14
    public function getMatchers()
15
    {
16
        return [
17
            'beEmpty' => function ($subject) {
18
                return empty($subject);
19
            },
20
        ];
21
    }
22
23
    function it_has_immutable_input()
24
    {
25
        $payload = $this->withInput(['input']);
26
        $payload->getInput()->shouldContain('input');
27
        $this->getInput()->shouldBeEmpty();
28
    }
29
30
    function it_has_immutable_output()
31
    {
32
        $payload = $this->withOutput('output');
33
        $payload->getOutput()->shouldBe('output');
34
        $this->getInput()->shouldBeEmpty();
35
    }
36
37
    function it_has_status()
38
    {
39
        $this->getStatus()->shouldBe('status');
40
    }
41
42
    function it_is_initializable()
43
    {
44
        $this->shouldImplement(\Venta\Contracts\Adr\Payload::class);
45
    }
46
}
47