Passed
Push — master ( d21404...27166b )
by Alessandro
56s queued 11s
created

FilterTest::testWithFromDateToDateFilters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
dl 14
loc 14
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Tests;
4
5
6
use PHPUnit\Framework\TestCase;
7
use TrelloCycleTime\Filter;
8
9
class FilterTest extends TestCase
10
{
11
    public function testWithEmptyValues()
12
    {
13
        $filtersArray = [];
14
        $filter = Filter::createFromArray($filtersArray);
15
16
        $this->assertFalse($filter->isFromColumnEnabled());
17
        $this->assertFalse($filter->isToColumnEnabled());
18
        $this->assertFalse($filter->isFromDateEnabled());
19
        $this->assertFalse($filter->isToDateEnabled());
20
    }
21
22 View Code Duplication
    public function testWithFromColumnToColumnFilters()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
    {
24
        $filtersArray = [
25
            'fromColumn' => 'fromColumn',
26
            'toColumn' => 'toColumn'
27
        ];
28
        $filter = Filter::createFromArray($filtersArray);
29
30
        $this->assertTrue($filter->isFromColumnEnabled());
31
        $this->assertTrue($filter->isToColumnEnabled());
32
33
        $this->assertEquals('fromColumn', $filter->getFromColumn());
34
        $this->assertEquals('toColumn', $filter->getToColumn());
35
    }
36
37 View Code Duplication
    public function testWithFromDateToDateFilters()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
38
    {
39
        $filtersArray = [
40
            'fromDate' => 'fromDate',
41
            'toDate' => 'toDate'
42
        ];
43
        $filter = Filter::createFromArray($filtersArray);
44
45
        $this->assertTrue($filter->isFromDateEnabled());
46
        $this->assertTrue($filter->isToDateEnabled());
47
48
        $this->assertEquals('fromDate', $filter->getFromDate());
49
        $this->assertEquals('toDate', $filter->getToDate());
50
    }
51
}