@@ 21-28 (lines=8) @@ | ||
18 | ||
19 | class Array2ObjectContextTest extends \PHPUnit_Framework_TestCase |
|
20 | { |
|
21 | public function testGetSetParsers() |
|
22 | { |
|
23 | $context = new Array2ObjectContext(); |
|
24 | $parsers = [new StringParser(), new IntegerParser()]; |
|
25 | $context->setParsers($parsers); |
|
26 | ||
27 | static::assertEquals(['string' => new StringParser(), 'integer' => new IntegerParser()], $context->getParsers()); |
|
28 | } |
|
29 | ||
30 | public function testAppendParsers() |
|
31 | { |
|
@@ 30-37 (lines=8) @@ | ||
27 | static::assertEquals(['string' => new StringParser(), 'integer' => new IntegerParser()], $context->getParsers()); |
|
28 | } |
|
29 | ||
30 | public function testAppendParsers() |
|
31 | { |
|
32 | $context = new Array2ObjectContext(); |
|
33 | $parsers = [new StringParser()]; |
|
34 | $context->setParsers($parsers); |
|
35 | $context->appendParser(new IntegerParser()); |
|
36 | static::assertEquals(['string' => new StringParser(), 'integer' => new IntegerParser()], $context->getParsers()); |
|
37 | } |
|
38 | ||
39 | public function testPrependParsers() |
|
40 | { |
|
@@ 39-46 (lines=8) @@ | ||
36 | static::assertEquals(['string' => new StringParser(), 'integer' => new IntegerParser()], $context->getParsers()); |
|
37 | } |
|
38 | ||
39 | public function testPrependParsers() |
|
40 | { |
|
41 | $context = new Array2ObjectContext(); |
|
42 | $parsers = [new StringParser(), new IntegerParser()]; |
|
43 | $context->setParsers($parsers); |
|
44 | $context->prependParser(new IntegerParser()); |
|
45 | static::assertEquals(['integer' => new IntegerParser(), 'string' => new StringParser()], $context->getParsers()); |
|
46 | } |
|
47 | ||
48 | public function testGetSetPropertyMatcher() |
|
49 | { |