YoutubeTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldNotHaveToPassHttpClientToConstructor() 0 5 1
A shouldAllowToPassHttpClientToConstructor() 0 5 1
1
<?php
2
3
/**
4
 * This file is a part of nekland youtube api package
5
 *
6
 * (c) Nekland <[email protected]>
7
 *
8
 * For the full license, take a look to the LICENSE file
9
 * on the root directory of this project
10
 */
11
12
namespace Nekland\Tests;
13
14
15
use Nekland\YoutubeApi\Youtube;
16
17
class YoutubeTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * @test
21
     */
22
    public function shouldNotHaveToPassHttpClientToConstructor()
23
    {
24
        $api = new Youtube();
25
        $this->assertInstanceOf('Nekland\\YoutubeApi\\Http\\HttpClient', $api->getClient());
26
    }
27
28
    /**
29
     * @test
30
     */
31
    public function shouldAllowToPassHttpClientToConstructor()
32
    {
33
        $api = new Youtube($this->prophesize('Nekland\\BaseApi\\Http\\ClientInterface')->reveal());
34
        $this->assertInstanceOf('Nekland\\BaseApi\\Http\\ClientInterface', $api->getClient());
35
    }
36
}
37