Completed
Push — add-language-status ( 18abf4...7eb792 )
by
unknown
01:55
created

LanguageStatusSpec::it_should_be_an_api()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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\Response;
8
use PhpSpec\ObjectBehavior;
9
use Prophecy\Argument;
10
11
class LanguageStatusSpec extends ObjectBehavior
12
{
13
    public function let(Client $client, HttpClient $http)
14
    {
15
        $client->getHttpClient()->willReturn($http);
16
        $client->getProjectIdentifier()->willReturn('akeneo');
17
        $client->getProjectApiKey()->willReturn('1234');
18
        $this->beConstructedWith($client);
19
    }
20
21
    public function it_should_be_an_api()
22
    {
23
        $this->shouldBeAnInstanceOf('Akeneo\Crowdin\Api\AbstractApi');
24
    }
25
26 View Code Duplication
    public function it_gets_project_language_status(
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...
27
        HttpClient $http,
28
        Response $response
29
    ) {
30
        $this->setLanguage('fr')->shouldBe($this);
31
        $http->post('project/akeneo/language-status?key=1234', ["language" => 'fr'])->willReturn($response);
32
        $response->getBody(true)->willReturn('<xml></xml>');
33
        $this->execute()->shouldBe('<xml></xml>');
34
    }
35
}
36