Completed
Push — master ( 714513...22b03e )
by Andrii
10:33
created

ControllerTest::testCreated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * HiPanel core package.
4
 *
5
 * @link      https://hipanel.com/
6
 * @package   hipanel-core
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2014-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\tests\unit\base;
12
13
use hipanel\base\Controller;
14
15
class ControllerTest extends \PHPUnit\Framework\TestCase
16
{
17
    /**
18
     * @var Controller
19
     */
20
    protected $object;
21
22
    protected function setUp()
23
    {
24
        $this->object = new Controller('test', null);
0 ignored issues
show
Documentation introduced by
null is of type null, but the function expects a object<yii\base\Module>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
25
    }
26
27
    protected function tearDown()
28
    {
29
    }
30
31
    public function testCreated()
32
    {
33
        $this->assertInstanceOf(Controller::class, $this->object);
34
    }
35
}
36