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

JobInstancesSpec::it_provides_jobintances()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 10
loc 10
rs 9.9332
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