@@ 28-37 (lines=10) @@ | ||
25 | static::assertInstanceOf('Graze\ArrayFilter\ArrayFilterInterface', $filter); |
|
26 | } |
|
27 | ||
28 | public function testSingleChildConstructorEqualsMatchesAll() |
|
29 | { |
|
30 | $filter = new AllOfFilter([ |
|
31 | new ClosureFilter('test', function ($actual) { |
|
32 | return $actual == 'value'; |
|
33 | }), |
|
34 | ]); |
|
35 | static::assertTrue($filter->matches(['test' => 'value'])); |
|
36 | static::assertFalse($filter->matches(['test' => 'values'])); |
|
37 | } |
|
38 | ||
39 | public function testSingleChildAddedLaterEqualsMatchesAll() |
|
40 | { |
|
@@ 39-47 (lines=9) @@ | ||
36 | static::assertFalse($filter->matches(['test' => 'values'])); |
|
37 | } |
|
38 | ||
39 | public function testSingleChildAddedLaterEqualsMatchesAll() |
|
40 | { |
|
41 | $filter = new AllOfFilter(); |
|
42 | $filter->addFilter(new ClosureFilter('test', function ($actual) { |
|
43 | return $actual == 'value'; |
|
44 | })); |
|
45 | static::assertTrue($filter->matches(['test' => 'value'])); |
|
46 | static::assertFalse($filter->matches(['test' => 'values'])); |
|
47 | } |
|
48 | ||
49 | public function testMultipleChildrenWithDifferentPropertiesMatchesAll() |
|
50 | { |
@@ 29-36 (lines=8) @@ | ||
26 | static::assertInstanceOf('Graze\ArrayFilter\ArrayFilterInterface', $filter); |
|
27 | } |
|
28 | ||
29 | public function testBasicEquals() |
|
30 | { |
|
31 | $filter = new ClosureFilter('test', function ($actual) { |
|
32 | return $actual == 'value'; |
|
33 | }); |
|
34 | static::assertTrue($filter->matches(['test' => 'value'])); |
|
35 | static::assertFalse($filter->matches(['test' => 'values'])); |
|
36 | } |
|
37 | ||
38 | public function testReturnsFalseWhenInvalidPropertySpecified() |
|
39 | { |
@@ 28-37 (lines=10) @@ | ||
25 | static::assertInstanceOf('Graze\ArrayFilter\ArrayFilterInterface', $filter); |
|
26 | } |
|
27 | ||
28 | public function testSingleChildConstructorEqualsMatchesOne() |
|
29 | { |
|
30 | $filter = new OneOfFilter([ |
|
31 | new ClosureFilter('test', function ($actual) { |
|
32 | return $actual == 'value'; |
|
33 | }), |
|
34 | ]); |
|
35 | static::assertTrue($filter->matches(['test' => 'value'])); |
|
36 | static::assertFalse($filter->matches(['test' => 'values'])); |
|
37 | } |
|
38 | ||
39 | public function testSingleChildAddedLaterEqualsMatchesOne() |
|
40 | { |
|
@@ 39-47 (lines=9) @@ | ||
36 | static::assertFalse($filter->matches(['test' => 'values'])); |
|
37 | } |
|
38 | ||
39 | public function testSingleChildAddedLaterEqualsMatchesOne() |
|
40 | { |
|
41 | $filter = new OneOfFilter(); |
|
42 | $filter->addFilter(new ClosureFilter('test', function ($actual) { |
|
43 | return $actual == 'value'; |
|
44 | })); |
|
45 | static::assertTrue($filter->matches(['test' => 'value'])); |
|
46 | static::assertFalse($filter->matches(['test' => 'values'])); |
|
47 | } |
|
48 | ||
49 | public function testMultipleChildrenWithDifferentPropertiesMatchesOne() |
|
50 | { |