@@ -31,18 +31,6 @@ final class FileHandlerTest extends AbstractHandlerTestCase
3131 private static string $ directory = 'FileHandler ' ;
3232 private Cache $ config ;
3333
34- /**
35- * @return list<string>
36- */
37- private static function getKeyArray (): array
38- {
39- return [
40- self ::$ key1 ,
41- self ::$ key2 ,
42- self ::$ key3 ,
43- ];
44- }
45-
4634 protected function setUp (): void
4735 {
4836 parent ::setUp ();
@@ -69,15 +57,8 @@ protected function tearDown(): void
6957 if (is_dir ($ this ->config ->file ['storePath ' ])) {
7058 chmod ($ this ->config ->file ['storePath ' ], 0777 );
7159
72- foreach (self ::getKeyArray () as $ key ) {
73- if (is_file ($ this ->config ->file ['storePath ' ] . DIRECTORY_SEPARATOR . $ key )) {
74- chmod ($ this ->config ->file ['storePath ' ] . DIRECTORY_SEPARATOR . $ key , 0777 );
75- unlink ($ this ->config ->file ['storePath ' ] . DIRECTORY_SEPARATOR . $ key );
76- }
77- if (is_file ($ this ->config ->file ['storePath ' ] . DIRECTORY_SEPARATOR . $ this ->config ->prefix . $ key )) {
78- chmod ($ this ->config ->file ['storePath ' ] . DIRECTORY_SEPARATOR . $ this ->config ->prefix . $ key , 0777 );
79- unlink ($ this ->config ->file ['storePath ' ] . DIRECTORY_SEPARATOR . $ this ->config ->prefix . $ key );
80- }
60+ if (isset ($ this ->handler )) {
61+ $ this ->handler ->clean ();
8162 }
8263
8364 rmdir ($ this ->config ->file ['storePath ' ]);
@@ -118,7 +99,7 @@ public function testSetDefaultPath(): void
11899 */
119100 public function testGet (): void
120101 {
121- $ this ->handler ->save (self ::$ key1 , 'value ' , 2 );
102+ $ this ->assertTrue ( $ this -> handler ->save (self ::$ key1 , 'value ' , 2 ) );
122103
123104 $ this ->assertSame ('value ' , $ this ->handler ->get (self ::$ key1 ));
124105 $ this ->assertNull ($ this ->handler ->get (self ::$ dummy ));
0 commit comments