Completed
Push — master ( 804c7f...1d2ba7 )
by Dan Michael O.
01:59
created

FilesSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace spec\Scriptotek\Alma\Bibs;
4
5
use Scriptotek\Alma\Bibs\Bib;
6
use Scriptotek\Alma\Bibs\Representation;
7
use Scriptotek\Alma\Bibs\Files;
8
use Scriptotek\Alma\Client as AlmaClient;
9
use PhpSpec\ObjectBehavior;
10
use Prophecy\Argument;
11
use spec\Scriptotek\Alma\SpecHelper;
12
13
class FilesSpec extends ObjectBehavior
14
{
15
    public function let(AlmaClient $client, Bib $bib, Representation $representation)
16
    {
17
        $bib->mms_id = 'abc';
18
        $representation->representation_id = '123';
19
        $this->beConstructedWith($client, $bib, $representation);
20
    }
21
22
    public function it_is_initializable()
23
    {
24
        $this->shouldHaveType(Files::class);
25
    }
26
27
    protected function expectRequest($client)
28
    {
29
        $client->getJSON('/bibs/abc/representations/123/files')
30
            ->shouldBeCalled()
31
            ->willReturn(SpecHelper::getDummyData('files_response.json'));
32
    }
33
34
    public function it_is_countable(AlmaClient $client)
35
    {
36
        $this->expectRequest($client);
37
38
        $this->shouldHaveCount(96);
39
    }
40
}
41