1 | <?php |
||
17 | class BibSpec extends ObjectBehavior |
||
18 | { |
||
19 | public function let(AlmaClient $client, UriInterface $url) |
||
|
|||
20 | { |
||
21 | $this->beConstructedWith($client, '999104760474702204'); |
||
22 | } |
||
23 | |||
24 | protected function expectRequest($client, $url) |
||
25 | { |
||
26 | $client->buildUrl('/bibs/999104760474702204', []) |
||
27 | ->shouldBeCalled() |
||
28 | ->willReturn($url); |
||
29 | |||
30 | $client->getXML($url) |
||
31 | ->shouldBeCalled() |
||
32 | ->willReturn(SpecHelper::getDummyData('bib_response_iz.xml')); |
||
33 | } |
||
34 | |||
35 | public function it_is_lazy(AlmaClient $client) |
||
40 | |||
41 | public function it_loads_bib_data_when_needed(AlmaClient $client, UriInterface $url) |
||
47 | |||
48 | public function it_can_exist(AlmaClient $client, UriInterface $url) |
||
49 | { |
||
50 | $this->expectRequest($client, $url); |
||
51 | |||
52 | $this->exists()->shouldBe(true); |
||
53 | } |
||
54 | |||
55 | public function it_links_to_network_zone(AlmaClient $client, AlmaClient $nz, Bibs $bibs, Bib $nz_bib, UriInterface $url) |
||
67 | |||
68 | public function it_provides_lazy_access_to_holdings(AlmaClient $client) |
||
73 | |||
74 | public function it_has_a_MARC_record(AlmaClient $client, UriInterface $url) |
||
81 | |||
82 | public function it_can_be_edited(AlmaClient $client, UriInterface $url) |
||
83 | { |
||
84 | $this->expectRequest($client, $url); |
||
85 | |||
86 | $this->record->getField('245')->getSubfield('a')->setData('New title'); |
||
87 | |||
88 | $client->putXML($url, Argument::containingString('New title')) |
||
89 | ->shouldBeCalled(); |
||
90 | |||
91 | $this->save(); |
||
92 | } |
||
93 | |||
94 | public function it_catches_resource_not_found(AlmaClient $client, UriInterface $url) |
||
106 | } |
||
107 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.