| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function testParentNormalizerContext() |
||
| 12 | { |
||
| 13 | $ctx = new ParentNormalizerContext(); |
||
| 14 | $this->assertSame(0, $ctx->getLevel()); |
||
| 15 | $this->assertNull($ctx->getParent()); |
||
| 16 | $this->assertNull($ctx->getFormat()); |
||
| 17 | $this->assertNull($ctx->getRoot()); |
||
| 18 | |||
| 19 | $object = new \stdClass(); |
||
| 20 | /** @var ParentNormalizerContext $ctx */ |
||
| 21 | $ctx = $ctx->withRoot($object)->withFormat('json'); |
||
| 22 | |||
| 23 | $ctx = $ctx->withParent($object); |
||
| 24 | $this->assertSame(1, $ctx->getLevel()); |
||
| 25 | $this->assertSame($object, $ctx->getParent()); |
||
| 26 | $this->assertSame($object, $ctx->getRoot()); |
||
| 27 | $this->assertSame('json', $ctx->getFormat()); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |