Completed
Pull Request — master (#29)
by Nicolas
03:33 queued 01:42
created

InfoSpec::it_gets_project_info()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace spec\Akeneo\Crowdin\Api;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
use Akeneo\Crowdin\Client;
8
use Guzzle\Http\Client as HttpClient;
9
use Guzzle\Http\Message\Response;
10
use Guzzle\Http\Message\Request;
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
    function let(Client $client, HttpClient $http, Request $request, Response $response)
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($request);
20
        $request->send()->willReturn($response);
21
        $response->getBody(true)->willReturn('<xml></xml>');
22
        $this->beConstructedWith($client);
23
    }
24
25
    function it_should_be_an_api()
26
    {
27
        $this->shouldBeAnInstanceOf('Akeneo\Crowdin\Api\AbstractApi');
28
    }
29
30
    function it_gets_project_info()
31
    {
32
        $this->execute()->shouldBe('<xml></xml>');
33
    }
34
}
35