InfoSpec::let()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 4
1
<?php
2
3
namespace spec\Akeneo\Crowdin\Api;
4
5
use Akeneo\Crowdin\Client;
6
use GuzzleHttp\Client as HttpClient;
7
use GuzzleHttp\Psr7\Request;
8
use GuzzleHttp\Psr7\Response;
9
use PhpSpec\ObjectBehavior;
10
use Prophecy\Argument;
11
12 View Code Duplication
class InfoSpec extends ObjectBehavior
0 ignored issues
show
Duplication introduced by
This class 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...
13
{
14
    public function let(Client $client, HttpClient $http, Request $request, Response $response)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        $client->getHttpClient()->willReturn($http);
17
        $client->getProjectIdentifier()->willReturn('akeneo');
18
        $client->getProjectApiKey()->willReturn('1234');
19
        $http->get('project/akeneo/info?key=1234')->willReturn($response);
20
        $response->getBody()->willReturn('<xml></xml>');
21
        $this->beConstructedWith($client);
22
    }
23
24
    public function it_should_be_an_api()
25
    {
26
        $this->shouldBeAnInstanceOf('Akeneo\Crowdin\Api\AbstractApi');
27
    }
28
29
    public function it_gets_project_info()
30
    {
31
        $this->execute()->shouldBe('<xml></xml>');
32
    }
33
}
34