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

ClientSpec   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 6
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 32
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_has_a_project_identifier() 0 4 1
A it_has_a_project_api_key() 0 4 1
A it_has_a_http_client() 0 4 1
A it_allow_defined_api_method() 0 4 1
A it_should_not_allow_undefined_api_method() 0 4 1
1
<?php
2
3
namespace spec\Akeneo\Crowdin;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
8
class ClientSpec extends ObjectBehavior
9
{
10
    public function let()
11
    {
12
        $this->beConstructedWith('Akeneo', 'my_key');
13
    }
14
15
    public function it_has_a_project_identifier()
16
    {
17
        $this->getProjectIdentifier()->shouldReturn('Akeneo');
18
    }
19
20
    public function it_has_a_project_api_key()
21
    {
22
        $this->getProjectApiKey()->shouldReturn('my_key');
23
    }
24
25
    public function it_has_a_http_client()
26
    {
27
        $this->getHttpClient()->shouldBeAnInstanceOf('Guzzle\Http\Client');
28
    }
29
30
    public function it_allow_defined_api_method()
31
    {
32
        $this->api('download')->shouldReturnAnInstanceOf('Akeneo\Crowdin\Api\Download');
33
    }
34
35
    public function it_should_not_allow_undefined_api_method()
36
    {
37
        $this->shouldThrow('\InvalidArgumentException')->duringApi('unknow');
38
    }
39
}
40