| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function testParse() |
||
| 23 | { |
||
| 24 | $context = new Array2ObjectContext(); |
||
| 25 | $context->setWriter(new AccessorWriter()); |
||
| 26 | $context->setMatcher(new CamelizeMatcher()); |
||
| 27 | $context->setParsers([new StringParser()]); |
||
| 28 | $parser = new ObjectParser($context); |
||
| 29 | |||
| 30 | $object = new Team(); |
||
| 31 | $property = new \ReflectionProperty(get_class($object), 'name'); |
||
| 32 | |||
| 33 | /** @var Team $team */ |
||
| 34 | $team = $parser->toObjectValue(['name' => 'New Name'], 'Team', $property, $object); |
||
| 35 | static::assertInstanceOf(Team::class, $team); |
||
| 36 | static::assertEquals('New Name', $team->getName()); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |