TestCase   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A getYoutubeMock() 0 10 2
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\Api;
13
14
15
use Nekland\YoutubeApi\Youtube;
16
use Prophecy\Argument;
17
18
class TestCase extends \PHPUnit_Framework_TestCase
19
{
20
    /**
21
     * @param array $data an array of method => return for the httpclient mocked
22
     * @return Youtube
23
     */
24
    protected function getYoutubeMock(array $data)
25
    {
26
        $httpClient = $this->prophesize('Nekland\BaseApi\Http\ClientInterface');
27
28
        foreach($data as $method => $return) {
29
            $httpClient->$method(Argument::cetera())->willReturn($return);
30
        }
31
32
        return new Youtube($httpClient->reveal());
33
    }
34
}
35