| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 24 | public function testEmpty() |
||
| 25 | { |
||
| 26 | $filter = new TimeFilter(); |
||
| 27 | $filter->initialize('field_name', ['field_options' => ['class' => 'FooBar']]); |
||
| 28 | |||
| 29 | $builder = new ProxyQuery(new QueryBuilder()); |
||
|
|
|||
| 30 | |||
| 31 | $filter->filter($builder, 'alias', 'field', null); |
||
| 32 | $filter->filter($builder, 'alias', 'field', ''); |
||
| 33 | $filter->filter($builder, 'alias', 'field', ['value' => '']); |
||
| 34 | |||
| 35 | $this->assertEquals([], $builder->query); |
||
| 36 | $this->assertFalse($filter->isActive()); |
||
| 37 | } |
||
| 38 | |||
| 44 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: