XEditableActionTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 3 1
A testConstruct() 0 4 1
1
<?php
2
/**
3
 * X-editable extension for Yii2
4
 *
5
 * @link      https://github.com/hiqdev/yii2-x-editable
6
 * @package   yii2-x-editable
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\xeditable\tests\unit;
12
13
use hiqdev\xeditable\XEditableAction;
14
15
/**
16
 * Generated by PHPUnit_SkeletonGenerator on 2016-04-27 at 15:37:34.
17
 */
18
class XEditableActionTest extends \PHPUnit_Framework_TestCase
19
{
20
    /**
21
     * @var XEditableAction
22
     */
23
    protected $object;
24
25
    protected $app;
26
27
    protected function setUp()
28
    {
29
        $this->object = new XEditableAction('test', null);
0 ignored issues
show
Documentation introduced by
null is of type null, but the function expects a object<yii\base\Controller>.

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...
30
    }
31
32
    protected function tearDown()
33
    {
34
    }
35
36
    public function testConstruct()
37
    {
38
        $this->assertInstanceOf(XEditableAction::class, $this->object);
39
    }
40
}
41