LendingRequestsSpec   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A it_provides_filtering_options() 0 16 1
1
<?php
2
3
namespace spec\Scriptotek\Alma\TaskLists;
4
5
use PhpSpec\ObjectBehavior;
6
use Scriptotek\Alma\Client as AlmaClient;
7
use Scriptotek\Alma\Conf\Library;
8
use Scriptotek\Alma\TaskLists\ResourceSharingRequest;
9
use spec\Scriptotek\Alma\SpecHelper;
10
11
class LendingRequestsSpec extends ObjectBehavior
12
{
13
    public 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
            ->shouldBeCalledTimes(1)
23
            ->willReturn(SpecHelper::getDummyData('lending_requests_created.json'));
24
25
        $this->all()->shouldBeArray();
26
        $this->all()->shouldHaveCount(3);
27
        $this->all()[0]->shouldBeAnInstanceOf(ResourceSharingRequest::class);
28
    }
29
}
30