| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function testDeserialization() |
||
| 15 | { |
||
| 16 | $builder = new SerializerBuilder(); |
||
| 17 | |||
| 18 | $serializer = $builder |
||
| 19 | ->setDeserializationVisitor( |
||
| 20 | 'plain_text', |
||
| 21 | new PlainTextDeserializationVisitor(new IdenticalPropertyNamingStrategy()) |
||
| 22 | ) |
||
| 23 | ->build(); |
||
| 24 | |||
| 25 | $data = 'I am a silly API that returns responses in plain text'; |
||
| 26 | |||
| 27 | $result = $serializer->deserialize($data, 'string', 'plain_text'); |
||
| 28 | |||
| 29 | $this->assertSame($data, $result, 'Visitor modified the payload, it should have kept it intact.'); |
||
| 30 | } |
||
| 31 | } |
||
| 32 |