Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
44 | public function testWrite(): void |
||
45 | { |
||
46 | $path = tempnam(sys_get_temp_dir(), 'json'); |
||
47 | $json = new Json($path); |
||
48 | $data = ['foo' => 'bar']; |
||
49 | $json->write($data); |
||
50 | |||
51 | $json = file_get_contents($path); |
||
52 | $load = json_decode($json, true); |
||
53 | |||
54 | unlink($path); |
||
55 | $this->assertEquals('bar', $load['foo']); |
||
56 | } |
||
58 |