| Conditions | 1 |
| Paths | 1 |
| Total Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function testIsFilterValidForScalar() |
||
| 13 | { |
||
| 14 | $string = 'abcd'; |
||
| 15 | $int = 123; |
||
| 16 | $bool = true; |
||
| 17 | $null = null; |
||
| 18 | |||
| 19 | $entity = new \stdClass(); |
||
| 20 | $filter = new EntityFieldGteFilter(); |
||
| 21 | $filter->setEntityFieldName('title'); |
||
| 22 | |||
| 23 | $entity->title = $int; |
||
| 24 | $filter->setEntityFieldValue(124); |
||
| 25 | $this->assertEquals(false, $filter->isFilterValid($entity)); |
||
| 26 | $filter->setEntityFieldValue(122); |
||
| 27 | $this->assertEquals(true, $filter->isFilterValid($entity)); |
||
| 28 | |||
| 29 | $entity->title = $string; |
||
| 30 | $filter->setEntityFieldValue('abc'); |
||
| 31 | $this->assertEquals(true, $filter->isFilterValid($entity)); |
||
| 32 | |||
| 33 | $entity->title = $bool; |
||
| 34 | $filter->setEntityFieldValue($bool); |
||
| 35 | $this->assertEquals(true, $filter->isFilterValid($entity)); |
||
| 36 | |||
| 37 | |||
| 38 | $entity->title = $null; |
||
| 39 | $filter->setEntityFieldValue(1); |
||
| 40 | $this->assertEquals(false, $filter->isFilterValid($entity)); |
||
| 41 | } |
||
| 42 | } |