DataTablesOrderTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 14
dl 0
loc 45
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetColumn() 0 6 1
A test__construt() 0 6 1
A testSetDir() 0 12 1
1
<?php
2
3
/*
4
 * This file is part of the jquery-datatables-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\JQuery\DataTablesBundle\Tests\Model;
13
14
use WBW\Bundle\JQuery\DataTablesBundle\Model\DataTablesOrder;
15
use WBW\Bundle\JQuery\DataTablesBundle\Tests\AbstractTestCase;
16
17
/**
18
 * DataTables order test.
19
 *
20
 * @author webeweb <https://github.com/webeweb>
21
 * @package WBW\Bundle\JQuery\DataTablesBundle\Tests\Model
22
 */
23
class DataTablesOrderTest extends AbstractTestCase {
24
25
    /**
26
     * Test setColumn()
27
     *
28
     * @retrun void
29
     */
30
    public function testSetColumn(): void {
31
32
        $obj = new DataTablesOrder();
33
34
        $obj->setColumn(1);
35
        $this->assertEquals(1, $obj->getColumn());
36
    }
37
38
    /**
39
     * Test setDir()
40
     *
41
     * @retrun void
42
     */
43
    public function testSetDir(): void {
44
45
        $obj = new DataTablesOrder();
46
47
        $obj->setDir("asc");
48
        $this->assertEquals("ASC", $obj->getDir());
49
50
        $obj->setDir("desc");
51
        $this->assertEquals("DESC", $obj->getDir());
52
53
        $obj->setDir("exception");
54
        $this->assertEquals("ASC", $obj->getDir());
55
    }
56
57
    /**
58
     * Test __construct()
59
     *
60
     * @return void
61
     */
62
    public function test__construt(): void {
63
64
        $obj = new DataTablesOrder();
65
66
        $this->assertNull($obj->getColumn());
67
        $this->assertNull($obj->getDir());
68
    }
69
}
70