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