| @@ 50-63 (lines=14) @@ | ||
| 47 | ->shouldHaveType(Loan::class); |
|
| 48 | } |
|
| 49 | ||
| 50 | function it_can_be_on_loan(AlmaClient $client, User $user, Library $library, UriInterface $url) |
|
| 51 | { |
|
| 52 | $client->buildUrl('/bibs/990006312214702204/holdings/22163771200002204/items/23163771190002204/loans', []) |
|
| 53 | ->willReturn($url); |
|
| 54 | ||
| 55 | $client->getJSON($url) |
|
| 56 | ->shouldBeCalled() |
|
| 57 | ->willReturn(SpecHelper::getDummyData('item_loan_response.json')); |
|
| 58 | ||
| 59 | $user->id = 'Dan Michael'; |
|
| 60 | $library->code = 'THAT LIBRARY'; |
|
| 61 | ||
| 62 | $this->loan()->shouldHaveType(Loan::class); |
|
| 63 | } |
|
| 64 | ||
| 65 | function it_can_be_scanned_in(AlmaClient $client, Library $library, UriInterface $url) |
|
| 66 | { |
|
| @@ 64-75 (lines=12) @@ | ||
| 61 | $user->primaryId->shouldBe('12345'); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function it_provides_search(AlmaClient $client) |
|
| 65 | { |
|
| 66 | $client->getJSON(Argument::containingString('users'), Argument::any()) |
|
| 67 | ->willReturn(SpecHelper::getDummyData('users_response.json')); |
|
| 68 | ||
| 69 | $users = $this->search('last_name~banan'); |
|
| 70 | $first = $users->current(); |
|
| 71 | ||
| 72 | $first->shouldHaveType(User::class); |
|
| 73 | $first->primary_id->shouldBe('1234567'); |
|
| 74 | $first->primaryId->shouldBe('1234567'); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||