DataTablesSearchTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetValue() 0 6 1
A test__construct() 0 6 1
A testSetRegex() 0 6 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\DataTablesSearch;
15
use WBW\Bundle\JQuery\DataTablesBundle\Tests\AbstractTestCase;
16
17
/**
18
 * DataTables search test.
19
 *
20
 * @author webeweb <https://github.com/webeweb>
21
 * @package WBW\Bundle\JQuery\DataTablesBundle\Tests\Model
22
 */
23
class DataTablesSearchTest extends AbstractTestCase {
24
25
    /**
26
     * Test setRegex()
27
     *
28
     * @return void
29
     */
30
    public function testSetRegex(): void {
31
32
        $obj = new DataTablesSearch();
33
34
        $obj->setRegex(true);
35
        $this->assertTrue($obj->getRegex());
36
    }
37
38
    /**
39
     * Test setValue()
40
     *
41
     * @return void
42
     */
43
    public function testSetValue(): void {
44
45
        $obj = new DataTablesSearch();
46
47
        $obj->setValue("value");
48
        $this->assertEquals("value", $obj->getValue());
49
    }
50
51
    /**
52
     * Test __construct()
53
     */
54
    public function test__construct(): void {
55
56
        $obj = new DataTablesSearch();
57
58
        $this->assertFalse($obj->getRegex());
59
        $this->assertEquals("", $obj->getValue());
60
    }
61
}
62