@@ 8-40 (lines=33) @@ | ||
5 | use Netdudes\DataSourceryBundle\Query\FilterCondition; |
|
6 | use PHPUnit\Framework\TestCase; |
|
7 | ||
8 | class DateDataTypeTest extends TestCase |
|
9 | { |
|
10 | /** |
|
11 | * @var DateDataType |
|
12 | */ |
|
13 | private $dataType; |
|
14 | ||
15 | public function testExpectedAvailableFilterMethods() |
|
16 | { |
|
17 | $expectedAvailableMethods = [ |
|
18 | FilterCondition::METHOD_DATETIME_GT, |
|
19 | FilterCondition::METHOD_DATETIME_GTE, |
|
20 | FilterCondition::METHOD_DATETIME_EQ, |
|
21 | FilterCondition::METHOD_DATETIME_LTE, |
|
22 | FilterCondition::METHOD_DATETIME_LT, |
|
23 | FilterCondition::METHOD_DATETIME_NEQ, |
|
24 | ]; |
|
25 | ||
26 | $this->assertSame($expectedAvailableMethods, $this->dataType->getAvailableFilterMethods()); |
|
27 | } |
|
28 | ||
29 | public function testExpectedDefaultFilterMethod() |
|
30 | { |
|
31 | $expectedDefaultMethod = FilterCondition::METHOD_DATETIME_EQ; |
|
32 | ||
33 | $this->assertSame($expectedDefaultMethod, $this->dataType->getDefaultFilterMethod()); |
|
34 | } |
|
35 | ||
36 | protected function setUp() |
|
37 | { |
|
38 | $this->dataType = new DateDataType(); |
|
39 | } |
|
40 | } |
|
41 |
@@ 8-40 (lines=33) @@ | ||
5 | use Netdudes\DataSourceryBundle\Query\FilterCondition; |
|
6 | use PHPUnit\Framework\TestCase; |
|
7 | ||
8 | class PercentDataTypeTest extends TestCase |
|
9 | { |
|
10 | /** |
|
11 | * @var PercentDataType |
|
12 | */ |
|
13 | private $dataType; |
|
14 | ||
15 | public function testExpectedDefaultFilterMethod() |
|
16 | { |
|
17 | $expectedDefaultMethod = FilterCondition::METHOD_NUMERIC_EQ; |
|
18 | ||
19 | $this->assertSame($expectedDefaultMethod, $this->dataType->getDefaultFilterMethod()); |
|
20 | } |
|
21 | ||
22 | public function testExpectedAvailableFilterMethods() |
|
23 | { |
|
24 | $expectedAvailableMethods = [ |
|
25 | FilterCondition::METHOD_NUMERIC_GT, |
|
26 | FilterCondition::METHOD_NUMERIC_GTE, |
|
27 | FilterCondition::METHOD_NUMERIC_EQ, |
|
28 | FilterCondition::METHOD_NUMERIC_LTE, |
|
29 | FilterCondition::METHOD_NUMERIC_LT, |
|
30 | FilterCondition::METHOD_NUMERIC_NEQ, |
|
31 | ]; |
|
32 | ||
33 | $this->assertSame($expectedAvailableMethods, $this->dataType->getAvailableFilterMethods()); |
|
34 | } |
|
35 | ||
36 | protected function setUp() |
|
37 | { |
|
38 | $this->dataType = new PercentDataType(); |
|
39 | } |
|
40 | } |
|
41 |
@@ 8-39 (lines=32) @@ | ||
5 | use Netdudes\DataSourceryBundle\Query\FilterCondition; |
|
6 | use PHPUnit\Framework\TestCase; |
|
7 | ||
8 | class StringDataTypeTest extends TestCase |
|
9 | { |
|
10 | /** |
|
11 | * @var StringDataType |
|
12 | */ |
|
13 | private $dataType; |
|
14 | ||
15 | public function testExpectedAvailableFilterMethods() |
|
16 | { |
|
17 | $expectedAvailableMethods = [ |
|
18 | FilterCondition::METHOD_STRING_EQ, |
|
19 | FilterCondition::METHOD_STRING_NEQ, |
|
20 | FilterCondition::METHOD_STRING_LIKE, |
|
21 | FilterCondition::METHOD_IN, |
|
22 | FilterCondition::METHOD_NIN, |
|
23 | ]; |
|
24 | ||
25 | $this->assertSame($expectedAvailableMethods, $this->dataType->getAvailableFilterMethods()); |
|
26 | } |
|
27 | ||
28 | public function testExpectedDefaultFilterMethod() |
|
29 | { |
|
30 | $expectedDefaultMethod = FilterCondition::METHOD_STRING_EQ; |
|
31 | ||
32 | $this->assertSame($expectedDefaultMethod, $this->dataType->getDefaultFilterMethod()); |
|
33 | } |
|
34 | ||
35 | protected function setUp() |
|
36 | { |
|
37 | $this->dataType = new StringDataType(); |
|
38 | } |
|
39 | } |
|
40 |