TariffControllerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

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
 * Finance module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-finance
6
 * @package   hipanel-module-finance
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\finance\tests\unit\controllers;
12
13
use hipanel\modules\finance\controllers\TariffController;
14
15
/**
16
 * Generated by PHPUnit_SkeletonGenerator on 2016-04-27 at 13:36:04.
17
 */
18
class TariffControllerTest extends \PHPUnit\Framework\TestCase
19
{
20
    /**
21
     * @var TariffController
22
     */
23
    protected $object;
24
25
    protected function setUp(): void
26
    {
27
        $this->object = new TariffController('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...
28
    }
29
30
    protected function tearDown(): void
31
    {
32
    }
33
34
    public function testActions()
35
    {
36
        $this->assertInternalType('array', $this->object->actions());
0 ignored issues
show
Bug introduced by
The method assertInternalType() does not seem to exist on object<hipanel\modules\f...s\TariffControllerTest>.

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...
37
    }
38
}
39