Code Duplication    Length = 28-29 lines in 3 locations

Tests/DataType/BooleanDataTypeTest.php 1 location

@@ 8-35 (lines=28) @@
5
use Netdudes\DataSourceryBundle\Query\FilterCondition;
6
use PHPUnit\Framework\TestCase;
7
8
class BooleanDataTypeTest extends TestCase
9
{
10
    /**
11
     * @var BooleanDataType
12
     */
13
    private $dataType;
14
15
    public function testExpectedAvailableFilterMethods()
16
    {
17
        $expectedAvailableMethods = [
18
            FilterCondition::METHOD_BOOLEAN
19
        ];
20
21
        $this->assertSame($expectedAvailableMethods, $this->dataType->getAvailableFilterMethods());
22
    }
23
24
    public function testExpectedDefaultFilterMethod()
25
    {
26
        $expectedDefaultMethod = FilterCondition::METHOD_BOOLEAN;
27
28
        $this->assertSame($expectedDefaultMethod, $this->dataType->getDefaultFilterMethod());
29
    }
30
31
    protected function setUp()
32
    {
33
        $this->dataType = new BooleanDataType();
34
    }
35
}
36

Tests/DataType/EntityDataTypeTest.php 1 location

@@ 8-36 (lines=29) @@
5
use Netdudes\DataSourceryBundle\Query\FilterCondition;
6
use PHPUnit\Framework\TestCase;
7
8
class EntityDataTypeTest extends TestCase
9
{
10
    /**
11
     * @var EntityDataType
12
     */
13
    private $dataType;
14
15
    public function testExpectedAvailableFilterMethods()
16
    {
17
        $expectedAvailableMethods = [
18
            FilterCondition::METHOD_NUMERIC_EQ,
19
            FilterCondition::METHOD_NUMERIC_NEQ,
20
        ];
21
22
        $this->assertSame($expectedAvailableMethods, $this->dataType->getAvailableFilterMethods());
23
    }
24
25
    public function testExpectedDefaultFilterMethod()
26
    {
27
        $expectedDefaultMethod = FilterCondition::METHOD_NUMERIC_EQ;
28
29
        $this->assertSame($expectedDefaultMethod, $this->dataType->getDefaultFilterMethod());
30
    }
31
32
    protected function setUp()
33
    {
34
        $this->dataType = new EntityDataType();
35
    }
36
}
37

Tests/DataType/SearchTextDataTypeTest.php 1 location

@@ 8-36 (lines=29) @@
5
use Netdudes\DataSourceryBundle\Query\FilterCondition;
6
use PHPUnit\Framework\TestCase;
7
8
class SearchTextDataTypeTest extends TestCase
9
{
10
    /**
11
     * @var SearchTextDataType
12
     */
13
    private $dataType;
14
15
    public function testExpectedAvailableFilterMethods()
16
    {
17
        $expectedAvailableMethods = [
18
            FilterCondition::METHOD_STRING_EQ,
19
            FilterCondition::METHOD_STRING_LIKE,
20
        ];
21
22
        $this->assertSame($expectedAvailableMethods, $this->dataType->getAvailableFilterMethods());
23
    }
24
25
    public function testExpectedDefaultFilterMethod()
26
    {
27
        $expectedDefaultMethod = FilterCondition::METHOD_STRING_LIKE;
28
29
        $this->assertSame($expectedDefaultMethod, $this->dataType->getDefaultFilterMethod());
30
    }
31
32
    protected function setUp()
33
    {
34
        $this->dataType = new SearchTextDataType();
35
    }
36
}
37