@@ 27-39 (lines=13) @@ | ||
24 | self::assertSame(CACHE_PATH . DIRECTORY_SEPARATOR . 'test.php', $manager->filePath('test')); |
|
25 | } |
|
26 | ||
27 | public function test_put() |
|
28 | { |
|
29 | $manager = new Manager(); |
|
30 | $data = [1, 2]; |
|
31 | $manager->put('test-save', $data); |
|
32 | self::assertFileExists(CACHE_PATH . DIRECTORY_SEPARATOR . 'test-save.php'); |
|
33 | ||
34 | $manager = new Manager(); |
|
35 | $manager->setActive(true); |
|
36 | self::assertSame($data, $manager->get('test-save')); |
|
37 | ||
38 | unlink(CACHE_PATH . DIRECTORY_SEPARATOR . 'test-save.php'); |
|
39 | } |
|
40 | ||
41 | public function test_saveData() |
|
42 | { |
|
@@ 41-53 (lines=13) @@ | ||
38 | unlink(CACHE_PATH . DIRECTORY_SEPARATOR . 'test-save.php'); |
|
39 | } |
|
40 | ||
41 | public function test_saveData() |
|
42 | { |
|
43 | $manager = new Manager(); |
|
44 | $data = [1, 2]; |
|
45 | $manager->saveData('test-save', $data); |
|
46 | self::assertFileExists(CACHE_PATH . DIRECTORY_SEPARATOR . 'test-save.php'); |
|
47 | ||
48 | $manager = new Manager(); |
|
49 | $manager->setActive(true); |
|
50 | self::assertSame($data, $manager->get('test-save')); |
|
51 | ||
52 | unlink(CACHE_PATH . DIRECTORY_SEPARATOR . 'test-save.php'); |
|
53 | } |
|
54 | } |
|
55 |