CommandTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
/**
3
 * ActiveRecord for API
4
 *
5
 * @link      https://github.com/hiqdev/yii2-hiart
6
 * @package   yii2-hiart
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\hiart\tests\unit;
12
13
use hiqdev\hiart\Command;
14
use Yii;
15
16
/**
17
 * Command test class.
18
 */
19
class CommandTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
{
21
    /**
22
     * @var Command
23
     */
24
    protected $command;
25
26
    protected $table = 'testAction';
27
    protected $columns = ['a' => 'b'];
28
29
    protected function setUp()
30
    {
31
        $this->command = Yii::createObject([
32
            'class' => Command::class,
33
            'db'    => Yii::$app->get('hiart'),
34
        ]);
35
    }
36
37
    protected function tearDown()
38
    {
39
    }
40
41
    public function testInsert()
42
    {
43
        $res = $this->command->insert($this->table, $this->columns);
44
        $this->assertInstanceOf(Command::class, $res);
45
    }
46
}
47