@@ 14-34 (lines=21) @@ | ||
11 | use spec\Scriptotek\Alma\SpecHelper; |
|
12 | ||
13 | ||
14 | class FeeSpec extends ObjectBehavior |
|
15 | { |
|
16 | public function let(AlmaClient $client, User $user) |
|
17 | { |
|
18 | $fee_id = '123435'; |
|
19 | $this->beConstructedWith($client, $user, $fee_id); |
|
20 | } |
|
21 | ||
22 | function it_is_initializable() |
|
23 | { |
|
24 | $this->shouldHaveType(Fee::class); |
|
25 | } |
|
26 | ||
27 | public function it_can_exist() |
|
28 | { |
|
29 | $this->init(SpecHelper::getDummyData('fee_response.json')); |
|
30 | ||
31 | $this->exists()->shouldBe(true); |
|
32 | $this->balance->shouldBe(750); |
|
33 | } |
|
34 | } |
|
35 |
@@ 13-32 (lines=20) @@ | ||
10 | use Scriptotek\Alma\Users\User; |
|
11 | use spec\Scriptotek\Alma\SpecHelper; |
|
12 | ||
13 | class LoanSpec extends ObjectBehavior |
|
14 | { |
|
15 | public function let(AlmaClient $client, User $user, Item $item) |
|
16 | { |
|
17 | $loan_id = '123'; |
|
18 | $this->beConstructedWith($client, $user, $item, $loan_id); |
|
19 | } |
|
20 | ||
21 | public function it_is_initializable() |
|
22 | { |
|
23 | $this->shouldHaveType(Loan::class); |
|
24 | } |
|
25 | ||
26 | public function it_can_exist() |
|
27 | { |
|
28 | $this->init(SpecHelper::getDummyData('item_loan_response.json')->item_loan[0]); |
|
29 | ||
30 | $this->exists()->shouldBe(true); |
|
31 | } |
|
32 | } |
|
33 |