Completed
Pull Request — master (#40)
by
unknown
03:47 queued 01:55
created

it_gets_project_language_status()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 9
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 9
loc 9
rs 9.6666
cc 1
eloc 7
nc 1
nop 2
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