Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function testDeserialize(): void |
||
16 | { |
||
17 | $args = [ |
||
18 | [ |
||
19 | 'argument' => 'value', |
||
20 | ], |
||
21 | ]; |
||
22 | $result = [(object)['a' => 'b']]; |
||
23 | $duration = 11.11; |
||
24 | |||
25 | $event = new RequestPostEvent('asd', $args, $result, $duration); |
||
26 | |||
27 | $serialized = serialize($event); |
||
28 | /** @var RequestPostEvent $unserialized */ |
||
29 | $unserialized = unserialize($serialized); |
||
30 | |||
31 | $this->assertSame('asd', $unserialized->getFname()); |
||
32 | $this->assertArrayHasKey(0, $unserialized->getArgs()); |
||
33 | $this->assertArrayHasKey('argument', $unserialized->getArgs()[0]); |
||
34 | $this->assertArrayHasKey(0, $unserialized->getResult()); |
||
35 | $this->assertObjectHasAttribute('a', $unserialized->getResult()[0]); |
||
36 | $this->assertSame('b', $unserialized->getResult()[0]->a); |
||
37 | $this->assertSame('value', $unserialized->getArgs()[0]['argument']); |
||
38 | $this->assertSame(11.11, $unserialized->getDuration()); |
||
39 | } |
||
40 | } |
||
41 |