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