Completed
Push — master ( 2f4865...be7731 )
by Andrii
02:34
created

unit/controllers/TravisYamlControllerTest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * Travis CI plugin for HiDev
5
 *
6
 * @link      https://github.com/hiqdev/hidev-travis
7
 * @package   hidev-travis
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hidev\travis\tests\unit\controllers;
13
14
use hidev\travis\controllers\TravisYamlController;
15
16
/**
17
 * Tests for TravisYamlController.
18
 */
19
class TravisYamlControllerTest extends \PHPUnit_Framework_TestCase
20
{
21
    /**
22
     * @var TravisYamlController
23
     */
24
    protected $object;
25
26
    protected function setUp()
27
    {
28
        $this->object = new TravisYamlController('.travis.yaml', null);
0 ignored issues
show
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...
29
    }
30
31
    protected function tearDown()
32
    {
33
    }
34
35
    public function testConstructor()
36
    {
37
        $this->assertInstanceOf('hidev\base\Controller', $this->object);
38
    }
39
}
40