Completed
Push — master ( 6dd6b9...53a464 )
by Andrii
12:52
created

CommandTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A tearDown() 0 3 1
A testInsert() 0 4 1
1
<?php
2
/**
3
 * Tools to use API as ActiveRecord for Yii2
4
 *
5
 * @link      https://github.com/hiqdev/yii2-hiart
6
 * @package   yii2-hiart
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, 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
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
        $this->command->insert($this->table, $this->columns);
44
    }
45
}
46