Completed
Push — fix-checkstyle ( 525678...700890 )
by
unknown
03:06
created

SupportedLanguagesSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 0
cbo 5
dl 0
loc 21
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 8 1
A it_should_be_an_api() 0 4 1
A it_gets_supported_languages() 0 4 1
1
<?php
2
3
namespace spec\Akeneo\Crowdin\Api;
4
5
use Akeneo\Crowdin\Client;
6
use Guzzle\Http\Client as HttpClient;
7
use Guzzle\Http\Message\Request;
8
use Guzzle\Http\Message\Response;
9
use PhpSpec\ObjectBehavior;
10
use Prophecy\Argument;
11
12
class SupportedLanguagesSpec extends ObjectBehavior
13
{
14
    public function let(Client $client, HttpClient $http, Request $request, Response $response)
15
    {
16
        $client->getHttpClient()->willReturn($http);
17
        $http->get('supported-languages')->willReturn($request);
18
        $request->send()->willReturn($response);
19
        $response->getBody(true)->willReturn('<xml></xml>');
20
        $this->beConstructedWith($client);
21
    }
22
23
    public function it_should_be_an_api()
24
    {
25
        $this->shouldBeAnInstanceOf('Akeneo\Crowdin\Api\AbstractApi');
26
    }
27
28
    public function it_gets_supported_languages()
29
    {
30
        $this->execute()->shouldBe('<xml></xml>');
31
    }
32
}
33