AuthManagerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 6
c 3
b 1
f 0
dl 0
loc 19
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createObject() 0 3 2
A setUp() 0 5 1
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-2020, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\rbac\tests\unit;
12
13
use hipanel\rbac\AuthManager;
14
15
/**
16
 * AuthManagerTest class.
17
 *
18
 * @author Andrii Vasyliev <[email protected]>
19
 */
20
class AuthManagerTest extends \PHPUnit\Framework\TestCase
21
{
22
    use CheckAccessTrait;
0 ignored issues
show
Bug introduced by
The trait hipanel\rbac\tests\unit\CheckAccessTrait requires the property $name which is not provided by hipanel\rbac\tests\unit\AuthManagerTest.
Loading history...
23
24
    /**
25
     * @var AuthManager
26
     */
27
    protected $auth;
28
29
    protected function setUp(): void
30
    {
31
        $this->auth = $this->createObject(AuthManager::class);
32
33
        $this->setAssignments();
34
    }
35
36
    protected function createObject($config)
37
    {
38
        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...
39
    }
40
}
41