@@ 190-200 (lines=11) @@ | ||
187 | * @test |
|
188 | * @covers ::filter |
|
189 | */ |
|
190 | public function chainFail() |
|
191 | { |
|
192 | $result = Filterer::filter( |
|
193 | ['fieldOne' => [['trim'], ['\TraderInteractive\FiltererTest::failingFilter']]], |
|
194 | ['fieldOne' => 'the value'] |
|
195 | ); |
|
196 | $this->assertSame( |
|
197 | [false, null, "Field 'fieldOne' with value 'the value' failed filtering, message 'i failed'", []], |
|
198 | $result |
|
199 | ); |
|
200 | } |
|
201 | ||
202 | /** |
|
203 | * @test |
|
@@ 655-661 (lines=7) @@ | ||
652 | * @tests |
|
653 | * @covers ::filter |
|
654 | */ |
|
655 | public function arrayizeAliasIsCalledProperly() |
|
656 | { |
|
657 | $this->assertSame( |
|
658 | [true, ['field' => ['a string value']], null, []], |
|
659 | Filterer::filter(['field' => [['arrayize']]], ['field' => 'a string value']) |
|
660 | ); |
|
661 | } |
|
662 | ||
663 | /** |
|
664 | * @tests |
|
@@ 667-673 (lines=7) @@ | ||
664 | * @tests |
|
665 | * @covers ::filter |
|
666 | */ |
|
667 | public function concatAliasIsCalledProperly() |
|
668 | { |
|
669 | $this->assertSame( |
|
670 | [true, ['field' => '%value%'], null, []], |
|
671 | Filterer::filter(['field' => [['concat', '%', '%']]], ['field' => 'value']) |
|
672 | ); |
|
673 | } |
|
674 | } |
|
675 |