Completed
Push — master ( bcb499...5b29f8 )
by Dan Michael O.
02:13
created

RequestsSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 5 1
A it_is_countable() 0 8 1
A it_is_initializable() 0 4 1
1
<?php
2
3
namespace spec\Scriptotek\Alma\Users;
4
5
use Scriptotek\Alma\Client as AlmaClient;
6
use Scriptotek\Alma\Users\Requests;
7
use PhpSpec\ObjectBehavior;
8
use Prophecy\Argument;
9
use spec\Scriptotek\Alma\SpecHelper;
10
11
class RequestsSpec extends ObjectBehavior
12
{
13
    public function let(AlmaClient $client)
14
    {
15
        $url = '/bibs/1/holdings/2/items/3/requests';
16
        $this->beConstructedWith($client, $url);
17
    }
18
19
    public function it_is_countable(AlmaClient $client)
20
    {
21
        $client->getJSON('/bibs/1/holdings/2/items/3/requests')
22
            ->shouldBeCalled()
23
            ->willReturn(SpecHelper::getDummyData('item_requests_response.json'));
24
25
        $this->shouldHaveCount(1);
26
    }
27
28
29
    function it_is_initializable()
30
    {
31
        $this->shouldHaveType(Requests::class);
32
    }
33
}
34