Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function testWrite() |
||
30 | { |
||
31 | $path = tempnam(sys_get_temp_dir(), 'json'); |
||
32 | $json = new Json($path); |
||
33 | $data = ['foo' => 'bar']; |
||
34 | $json->write($data); |
||
35 | |||
36 | $json = file_get_contents($path); |
||
37 | $load = json_decode($json, true); |
||
38 | |||
39 | unlink($path); |
||
40 | $this->assertEquals('bar', $load['foo']); |
||
41 | } |
||
42 | } |
||
43 |