Completed
Push — master ( 5516e9...f0e0a7 )
by Koen
01:45
created

ClientTest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 72
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testCharacters() 0 9 1
A testComics() 0 9 1
A testEvents() 0 9 1
A testCreators() 0 9 1
A testStories() 0 9 1
A testSeries() 0 9 1
1
<?php
2
3
namespace Ikoene\MarvelApiBundle\Tests\Controller;
4
5
use Ikoene\MarvelApiBundle\Controller\Client;
6
use PHPUnit\Framework\TestCase;
7
8
class ClientTest extends TestCase
9
{
10
    /**
11
     * @var Client
12
     */
13
    protected $client;
14
15
    protected function setUp()
16
    {
17
        $this->client = new Client(getenv('PUBLIC_API_KEY'), getenv('PRIVATE_API_KEY'));
18
    }
19
20
    function testCharacters()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
21
    {
22
        $response = $this->client->getCharacters();
23
24
        $this->assertInstanceOf(
25
            'Ikoene\MarvelApiBundle\DataWrapper\CharacterDataWrapper',
26
            $response
27
        );
28
    }
29
30
    function testComics()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
31
    {
32
        $response = $this->client->getComics();
33
34
        $this->assertInstanceOf(
35
            'Ikoene\MarvelApiBundle\DataWrapper\ComicDataWrapper',
36
            $response
37
        );
38
    }
39
40
    function testEvents()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
41
    {
42
        $response = $this->client->getEvents();
43
44
        $this->assertInstanceOf(
45
            'Ikoene\MarvelApiBundle\DataWrapper\EventDataWrapper',
46
            $response
47
        );
48
    }
49
50
    function testCreators()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
51
    {
52
        $response = $this->client->getCreators();
53
54
        $this->assertInstanceOf(
55
            'Ikoene\MarvelApiBundle\DataWrapper\CreatorDataWrapper',
56
            $response
57
        );
58
    }
59
60
    function testStories()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
61
    {
62
        $response = $this->client->getStories();
63
64
        $this->assertInstanceOf(
65
            'Ikoene\MarvelApiBundle\DataWrapper\StoryDataWrapper',
66
            $response
67
        );
68
    }
69
70
    function testSeries()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
71
    {
72
        $response = $this->client->getSeries();
73
74
        $this->assertInstanceOf(
75
            'Ikoene\MarvelApiBundle\DataWrapper\SeriesDataWrapper',
76
            $response
77
        );
78
    }
79
}
80