Completed
Push — master ( a29d2d...4681dd )
by Hannes
10:53 queued 08:08
created

OpeningNodeSpec   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 9
lcom 0
cbo 0
dl 0
loc 50
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace spec\byrokrat\autogiro\Tree;
6
7
use byrokrat\autogiro\Tree\OpeningNode;
8
use byrokrat\autogiro\Tree\Node;
9
use byrokrat\autogiro\Tree\BankgiroNode;
10
use byrokrat\autogiro\Tree\BgcCustomerNumberNode;
11
use PhpSpec\ObjectBehavior;
12
13
class OpeningNodeSpec extends ObjectBehavior
14
{
15
    function let(\DateTimeImmutable $date, BgcCustomerNumberNode $custNr, BankgiroNode $bankgiro)
16
    {
17
        $this->beConstructedWith('', $date, $custNr, $bankgiro);
18
    }
19
20
    function it_is_initializable()
21
    {
22
        $this->shouldHaveType(OpeningNode::CLASS);
23
    }
24
25
    function it_implements_node_interface()
26
    {
27
        $this->shouldHaveType(Node::CLASS);
28
    }
29
30
    function it_contains_a_type()
31
    {
32
        $this->getType()->shouldEqual('OpeningNode');
33
    }
34
35
    function it_contains_a_layout_name($date, $custNr, $bankgiro)
36
    {
37
        $this->beConstructedWith('layout', $date, $custNr, $bankgiro);
38
        $this->getAttribute('layout_name')->shouldEqual('layout');
39
    }
40
41
    function it_contains_a_date($date)
42
    {
43
        $this->getAttribute('date')->shouldEqual($date);
44
    }
45
46
    function it_contains_a_customer_number($custNr)
47
    {
48
        $this->getChild('customer_number')->shouldEqual($custNr);
49
    }
50
51
    function it_contains_a_bankgiro($bankgiro)
52
    {
53
        $this->getChild('bankgiro')->shouldEqual($bankgiro);
54
    }
55
56
    function it_contains_a_line_number($date, $custNr, $bankgiro)
57
    {
58
        $this->beConstructedWith('', $date, $custNr, $bankgiro, 10);
59
        $this->getLineNr()->shouldEqual(10);
60
    }
61
}
62