hiqdev /
hipanel-rbac
| 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 | use hipanel\rbac\Initer; |
||||||
| 15 | |||||||
| 16 | /** |
||||||
| 17 | * AuthManagerTest class. |
||||||
| 18 | * |
||||||
| 19 | * @author Andrii Vasyliev <[email protected]> |
||||||
| 20 | */ |
||||||
| 21 | class IniterTest extends \PHPUnit\Framework\TestCase |
||||||
| 22 | { |
||||||
| 23 | use CheckAccessTrait; |
||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||||
| 24 | |||||||
| 25 | /** |
||||||
| 26 | * @var AuthManager |
||||||
| 27 | */ |
||||||
| 28 | protected $auth; |
||||||
| 29 | |||||||
| 30 | protected function setUp(): void |
||||||
| 31 | { |
||||||
| 32 | $this->auth = $this->createObject(AuthManager::class); |
||||||
| 33 | |||||||
| 34 | $this->setAssignments(); |
||||||
| 35 | } |
||||||
| 36 | |||||||
| 37 | public function testReinit() |
||||||
| 38 | { |
||||||
| 39 | $this->assertNull((new Initer())->reinit($this->auth)); |
||||||
|
0 ignored issues
–
show
Are you sure the usage of
new hipanel\rbac\Initer()->reinit($this->auth) targeting hipanel\rbac\AbstractIniter::reinit() seems to always return null.
This check looks for function or method calls that always return null and whose return value is used. class A
{
function getObject()
{
return null;
}
}
$a = new A();
if ($a->getObject()) {
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes. Loading history...
The method
assertNull() does not exist on hipanel\rbac\tests\unit\IniterTest.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||||
| 40 | } |
||||||
| 41 | |||||||
| 42 | protected function createObject($config) |
||||||
| 43 | { |
||||||
| 44 | return class_exists('Yii') ? \Yii::createObject($config) : \yii\helpers\Yii::createObject($config); |
||||||
|
0 ignored issues
–
show
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||||
| 45 | } |
||||||
| 46 | } |
||||||
| 47 |