|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types = 1); |
|
4
|
|
|
|
|
5
|
|
|
namespace spec\byrokrat\autogiro\Tree; |
|
6
|
|
|
|
|
7
|
|
|
use byrokrat\autogiro\Tree\MandateResponseNode; |
|
8
|
|
|
use byrokrat\autogiro\Tree\Node; |
|
9
|
|
|
use byrokrat\autogiro\Tree\BankgiroNode; |
|
10
|
|
|
use byrokrat\autogiro\Tree\PayerNumberNode; |
|
11
|
|
|
use byrokrat\autogiro\Tree\AccountNode; |
|
12
|
|
|
use byrokrat\autogiro\Tree\IdNode; |
|
13
|
|
|
use byrokrat\autogiro\Tree\MessageNode; |
|
14
|
|
|
use PhpSpec\ObjectBehavior; |
|
15
|
|
|
use Prophecy\Argument; |
|
16
|
|
|
|
|
17
|
|
|
class MandateResponseNodeSpec extends ObjectBehavior |
|
18
|
|
|
{ |
|
19
|
|
|
function let( |
|
20
|
|
|
BankgiroNode $bankgiro, |
|
21
|
|
|
PayerNumberNode $payerNr, |
|
22
|
|
|
AccountNode $account, |
|
23
|
|
|
IdNode $id, |
|
24
|
|
|
MessageNode $info, |
|
25
|
|
|
MessageNode $comment, |
|
26
|
|
|
\DateTime $date |
|
27
|
|
|
) { |
|
28
|
|
|
$this->beConstructedWith($bankgiro, $payerNr, $account, $id, $info, $comment, $date); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
function it_is_initializable() |
|
32
|
|
|
{ |
|
33
|
|
|
$this->shouldHaveType(MandateResponseNode::CLASS); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
function it_implements_node_interface() |
|
37
|
|
|
{ |
|
38
|
|
|
$this->shouldHaveType(Node::CLASS); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
function it_contains_a_type() |
|
42
|
|
|
{ |
|
43
|
|
|
$this->getType()->shouldEqual('MandateResponseNode'); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
function it_contains_a_bankgiro($bankgiro) |
|
47
|
|
|
{ |
|
48
|
|
|
$this->getChild('bankgiro')->shouldEqual($bankgiro); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
function it_contains_a_payer_number($payerNr) |
|
52
|
|
|
{ |
|
53
|
|
|
$this->getChild('payer_number')->shouldEqual($payerNr); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
function it_contains_an_account($account) |
|
57
|
|
|
{ |
|
58
|
|
|
$this->getChild('account')->shouldEqual($account); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
function it_contains_an_id($id) |
|
62
|
|
|
{ |
|
63
|
|
|
$this->getChild('id')->shouldEqual($id); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
function it_contains_a_message($info) |
|
67
|
|
|
{ |
|
68
|
|
|
$this->getChild('info')->shouldEqual($info); |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
function it_contains_a_comment($comment) |
|
72
|
|
|
{ |
|
73
|
|
|
$this->getChild('comment')->shouldEqual($comment); |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
function it_contains_a_date($date) |
|
77
|
|
|
{ |
|
78
|
|
|
$this->getAttribute('date')->shouldEqual($date); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
function it_contains_a_line_number($bankgiro, $payerNr, $account, $id, $info, $comment, $date) |
|
82
|
|
|
{ |
|
83
|
|
|
$this->beConstructedWith($bankgiro, $payerNr, $account, $id, $info, $comment, $date, 100); |
|
84
|
|
|
$this->getLineNr()->shouldEqual(100); |
|
85
|
|
|
} |
|
86
|
|
|
} |
|
87
|
|
|
|