Completed
Push — master ( e20745...127efd )
by Andrii
15:54
created

ServerControllerTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 3 1
A testActions() 0 4 1
1
<?php
2
3
/*
4
 * Server module for HiPanel
5
 *
6
 * @link      https://github.com/hiqdev/hipanel-module-server
7
 * @package   hipanel-module-server
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\modules\server\tests\unit\controllers;
13
14
use hipanel\modules\server\controllers\ServerController;
15
16
class ServerControllerTest extends \PHPUnit_Framework_TestCase
17
{
18
    /**
19
     * @var ServerController
20
     */
21
    protected $object;
22
23
    protected function setUp()
24
    {
25
        $this->object = new ServerController('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...
26
    }
27
28
    protected function tearDown()
29
    {
30
    }
31
32
    public function testActions()
33
    {
34
        $this->assertInternalType('array', $this->object->actions());
35
    }
36
}
37