Test Setup Failed
Pull Request — master (#19)
by
unknown
01:55
created

JobsSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 6 1
A it_provides_a_lazy_interface_to_job_objects() 0 10 1
A it_provides_jobs() 0 5 1
1
<?php
2
3
namespace spec\Scriptotek\Alma\Conf;
4
5
use PhpSpec\ObjectBehavior;
6
use Scriptotek\Alma\Client as AlmaClient;
7
use Scriptotek\Alma\Conf\Job;
8
use spec\Scriptotek\Alma\SpecHelper;
9
10
class JobsSpec extends ObjectBehavior
11
{
12
    public function let(AlmaClient $client)
13
    {
14
        $this->beConstructedWith($client);
15
        $client->getJSON('/conf/jobs')
16
            ->willReturn(SpecHelper::getDummyData('jobs_response.json'));
17
    }
18
19
    public function it_provides_a_lazy_interface_to_job_objects(AlmaClient $client)
20
    {
21
        SpecHelper::expectNoRequests($client);
22
23
        $job_id = 'M26714670000011';
24
        $job = $this->get($job_id);
25
26
        $job->shouldBeAnInstanceOf(Job::class);
27
        $job->job_id->shouldBe($job_id);
28
    }
29
30
    public function it_provides_jobs()
31
    {
32
        $this->all()->shouldBeArray();
33
        $this->all()[0]->shouldBeAnInstanceOf(Job::class);
34
    }
35
}
36