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