Completed
Push — master ( 8247ab...4ae4bd )
by Andrii
32:57
created

CurlRepoTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 10 2
A tearDown() 0 4 1
1
<?php
2
/**
3
 * GitHub API implementation for yii2-hiart
4
 *
5
 * @link      https://github.com/hiqdev/yii2-hiart-github
6
 * @package   yii2-hiart-github
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\hiart\github\tests\functional;
12
13
use hiqdev\hiart\curl\Request;
14
use hiqdev\hiart\github\models\Repo;
15
use Yii;
16
17
class CurlRepoTest extends RepoTest
18
{
19
    protected static $github;
20
21
    public function setUp()
22
    {
23
        if (static::$github === null) {
24
            static::$github = Yii::$app->getComponents()['github'];
25
        }
26
27
        Yii::$app->set('github', array_merge(static::$github, [
28
            'requestClass' => Request::class,
29
        ]));
30
    }
31
32
    public function tearDown()
33
    {
34
        Yii::$app->set('github', static::$github);
35
    }
36
}
37