Code Duplication    Length = 20-22 lines in 2 locations

spec/Electronic/CollectionSpec.php 1 location

@@ 10-29 (lines=20) @@
7
use Scriptotek\Alma\Client as AlmaClient;
8
use spec\Scriptotek\Alma\SpecHelper;
9
10
class CollectionSpec extends ObjectBehavior
11
{
12
    public function let(AlmaClient $client)
13
    {
14
        $collection_id = '123';
15
        $this->beConstructedWith($client, $collection_id);
16
    }
17
18
    protected function expectRequest($client)
19
    {
20
        $client->getJSON('/electronic/e-collections/123')
21
            ->shouldBeCalled()
22
            ->willReturn(SpecHelper::getDummyData('e-collection_response.json'));
23
    }
24
25
    public function it_is_initializable()
26
    {
27
        $this->shouldHaveType(Collection::class);
28
    }
29
}
30

spec/Users/RequestsSpec.php 1 location

@@ 10-31 (lines=22) @@
7
use Scriptotek\Alma\Users\Requests;
8
use spec\Scriptotek\Alma\SpecHelper;
9
10
class RequestsSpec extends ObjectBehavior
11
{
12
    public function let(AlmaClient $client)
13
    {
14
        $url = '/bibs/1/holdings/2/items/3/requests';
15
        $this->beConstructedWith($client, $url);
16
    }
17
18
    public function it_is_countable(AlmaClient $client)
19
    {
20
        $client->getJSON('/bibs/1/holdings/2/items/3/requests')
21
            ->shouldBeCalled()
22
            ->willReturn(SpecHelper::getDummyData('item_requests_response.json'));
23
24
        $this->shouldHaveCount(1);
25
    }
26
27
    public function it_is_initializable()
28
    {
29
        $this->shouldHaveType(Requests::class);
30
    }
31
}
32