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