Code Duplication    Length = 29-31 lines in 4 locations

Tests/DataType/EntityDataTypeTest.php 1 location

@@ 7-36 (lines=30) @@
4
use Netdudes\DataSourceryBundle\DataType\EntityDataType;
5
use Netdudes\DataSourceryBundle\Query\FilterCondition;
6
7
class EntityDataTypeTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @var EntityDataType
11
     */
12
    private $dataType;
13
14
    public function testExpectedAvailableFilterMethods()
15
    {
16
        $expectedAvailableMethods = [
17
            FilterCondition::METHOD_NUMERIC_EQ,
18
            FilterCondition::METHOD_NUMERIC_NEQ,
19
            FilterCondition::METHOD_IS_NULL
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/EntityExistenceDataTypeTest.php 1 location

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

Tests/DataType/SearchTextDataTypeTest.php 1 location

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

Tests/DataType/StringDataTypeTest.php 1 location

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