Test Failed
Push — master ( 99cade...32f37c )
by Dan Michael O.
10:15
created

LendingRequestsSpec   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A it_provides_filtering_options() 0 17 1
1
<?php
2
3
namespace spec\Scriptotek\Alma\TaskLists;
4
5
use Scriptotek\Alma\Client as AlmaClient;
6
use Scriptotek\Alma\Conf\Library;
7
use PhpSpec\ObjectBehavior;
8
use Scriptotek\Alma\TaskLists\ResourceSharingRequest;
9
use spec\Scriptotek\Alma\SpecHelper;
10
11
class LendingRequestsSpec extends ObjectBehavior
12
{
13
    function it_provides_filtering_options(AlmaClient $client, Library $library)
14
    {
15
        $library->code = 'SOME_LIBRARY';
16
        $this->beConstructedWith($client, $library, [
17
            'printed' => 'N',
18
            'status' => 'REQUEST_CREATED_LEND',
19
        ]);
20
21
        $client->getJSON('/task-lists/rs/lending-requests?printed=N&status=REQUEST_CREATED_LEND&library=SOME_LIBRARY')
22
            ->shouldBeCalled()
23
            ->willReturn(SpecHelper::getDummyData('lending_requests_created.json'));
24
25
        $result = $this->all();
26
        $result->shouldBeArray();
27
        $result->shouldHaveCount(3);
28
        $result[0]->shouldBeAnInstanceOf(ResourceSharingRequest::class);
29
    }
30
}
31