ClientSpec::it_allow_defined_api_method()   A
last analyzed

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;
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('GuzzleHttp\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