Completed
Pull Request — master (#9)
by Hugo
01:31
created

ClientSpec   A

Complexity

Total Complexity 16

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 16
lcom 0
cbo 1
dl 0
loc 70
rs 10
c 0
b 0
f 0

16 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A let() 0 4 1
A it_should_send_auth_request_before_graphql_request() 0 3 1
A it_should_handle_case_where_api_token_is_invalid() 0 3 1
A it_should_handle_case_auth_response_returns_401() 0 3 1
A it_should_handle_case_auth_response_is_invalid_json() 0 3 1
A it_should_send_graphql_query() 0 3 1
A it_should_send_graphql_query_with_variables() 0 3 1
A it_should_handle_case_when_graphql_query_returns_errors() 0 3 1
A it_should_handle_case_when_graphql_query_returns_warnings() 0 3 1
A it_should_send_graphql_mutation() 0 3 1
A it_should_send_graphql_mutation_with_variables() 0 3 1
A it_should_handle_case_when_mutation_query_returns_errors() 0 3 1
A it_should_handle_case_when_mutation_query_returns_warnings() 0 3 1
A it_should_upload_files_and_respect_client_immutability() 0 3 1
A it_should_handle_case_when_uploading_is_failing() 0 3 1
1
<?php
2
3
namespace spec\Yproximite\Api;
4
5
use Http\Client\HttpClient;
6
use Http\Message\MessageFactory;
7
use PhpSpec\ObjectBehavior;
8
use Yproximite\Api\Client;
9
10
class ClientSpec extends ObjectBehavior
11
{
12
    const GRAPHQL_ENDPOINT = 'https://graphql.yproximite.fr';
13
14
    function it_is_initializable()
15
    {
16
        $this->shouldHaveType(Client::class);
17
    }
18
19
    function let(HttpClient $httpClient, MessageFactory $messageFactory)
20
    {
21
        $this->beConstructedWith($httpClient, '<api_key>', self::GRAPHQL_ENDPOINT, $messageFactory);
22
    }
23
24
    function it_should_send_auth_request_before_graphql_request()
25
    {
26
    }
27
28
    function it_should_handle_case_where_api_token_is_invalid()
29
    {
30
    }
31
32
    function it_should_handle_case_auth_response_returns_401()
33
    {
34
    }
35
36
    function it_should_handle_case_auth_response_is_invalid_json()
37
    {
38
    }
39
40
    function it_should_send_graphql_query()
41
    {
42
    }
43
44
    function it_should_send_graphql_query_with_variables()
45
    {
46
    }
47
48
    function it_should_handle_case_when_graphql_query_returns_errors()
49
    {
50
    }
51
52
    function it_should_handle_case_when_graphql_query_returns_warnings()
53
    {
54
    }
55
56
    function it_should_send_graphql_mutation()
57
    {
58
    }
59
60
    function it_should_send_graphql_mutation_with_variables()
61
    {
62
    }
63
64
    function it_should_handle_case_when_mutation_query_returns_errors()
65
    {
66
    }
67
68
    function it_should_handle_case_when_mutation_query_returns_warnings()
69
    {
70
    }
71
72
    function it_should_upload_files_and_respect_client_immutability()
73
    {
74
    }
75
76
    function it_should_handle_case_when_uploading_is_failing()
77
    {
78
    }
79
}
80