Test Setup Failed
Push — master ( 8a6c4e...2f310d )
by Dan Michael O.
07:45
created

JobInstancesSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
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 Scriptotek\Alma\Conf\JobInstance;
9
use spec\Scriptotek\Alma\SpecHelper;
10
11
class JobInstancesSpec extends ObjectBehavior
12
{
13
    public function let(AlmaClient $client, Job $job)
14
    {
15
        $job->job_id = '1108569450000121';
16
        $this->beConstructedWith($client, $job);
17
    }
18
19
    public function it_provides_a_lazy_interface_to_jobinstance_objects(AlmaClient $client)
20
    {
21
        SpecHelper::expectNoRequests($client);
22
23
        $jobId = '1108569450000121';
24
        $instanceId = '1108569450000121';
25
        $jobInstance = $this->get($jobId, $instanceId);
26
        $jobInstance->shouldBeAnInstanceOf(JobInstance::class);
27
    }
28
29 View Code Duplication
    public function it_provides_jobintances(AlmaClient $client)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
    {
31
        $jobId = '1108569450000121';
32
        $client->getJSON("/conf/jobs/{$jobId}/instances")
33
            ->shouldBeCalled()
34
            ->willReturn(SpecHelper::getDummyData('jobinstances_response.json'));
35
36
        $this->all()->shouldBeArray();
37
        $this->all()[0]->shouldBeAnInstanceOf(JobInstance::class);
38
    }
39
}
40