| @@ 78-88 (lines=11) @@ | ||
| 75 | static::assertFalse($filter->matches(['test' => 'bar'])); |
|
| 76 | } |
|
| 77 | ||
| 78 | public function testCallableFilters() |
|
| 79 | { |
|
| 80 | $filter = new AllOfFilter([ |
|
| 81 | function (array $data) { |
|
| 82 | return isset($data['test']) && $data['test'] == 'value'; |
|
| 83 | } |
|
| 84 | ]); |
|
| 85 | static::assertTrue($filter(['test' => 'value'])); |
|
| 86 | static::assertFalse($filter(['test' => 'values'])); |
|
| 87 | static::assertFalse($filter(['tests' => 'values'])); |
|
| 88 | } |
|
| 89 | ||
| 90 | public function testAllOfFilterCanBeInvoked() |
|
| 91 | { |
|
| @@ 80-90 (lines=11) @@ | ||
| 77 | static::assertTrue($filter->matches(['test' => 'bar'])); |
|
| 78 | } |
|
| 79 | ||
| 80 | public function testCallableFilters() |
|
| 81 | { |
|
| 82 | $filter = new OneOfFilter([ |
|
| 83 | function (array $data) { |
|
| 84 | return isset($data['test']) && $data['test'] == 'value'; |
|
| 85 | } |
|
| 86 | ]); |
|
| 87 | static::assertTrue($filter(['test' => 'value'])); |
|
| 88 | static::assertFalse($filter(['test' => 'values'])); |
|
| 89 | static::assertFalse($filter(['tests' => 'values'])); |
|
| 90 | } |
|
| 91 | ||
| 92 | public function testOneOfFilterCanBeInvoked() |
|
| 93 | { |
|