Passed
Push — master ( d1bf2b...e3ab8d )
by Andrii
01:41
created

IniterTest::createObject()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 2
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * RBAC implementation for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-rbac
6
 * @package   hipanel-rbac
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\rbac\tests\unit;
12
13
use hipanel\rbac\AuthManager;
14
use hipanel\rbac\Initer;
15
16
/**
17
 * AuthManagerTest class.
18
 *
19
 * @author Andrii Vasyliev <[email protected]>
20
 */
21
class IniterTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
22
{
23
    use CheckAccessTrait;
24
25
    /**
26
     * @var AuthManager
27
     */
28
    protected $auth;
29
30
    protected function setUp()
31
    {
32
        $this->auth = $this->createObject(AuthManager::class);
33
34
        (new Initer())->reinit($this->auth);
35
        $this->setAssignments();
36
    }
37
38
    protected function createObject($config)
39
    {
40
        return class_exists('Yii') ? \Yii::createObject($config) : \yii\helpers\Yii::createObject($config);
0 ignored issues
show
Bug introduced by
The type yii\helpers\Yii was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
41
    }
42
}
43