|
|
@@ -556,6 +556,34 @@ class CacheTest extends TestCase
|
|
|
Cache::enable();
|
|
|
Cache::clear(false, 'test_cache_disable_2');
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * test clearAll() method
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testClearAll()
|
|
|
+ {
|
|
|
+ Cache::config('configTest', [
|
|
|
+ 'engine' => 'File',
|
|
|
+ 'path' => TMP . 'tests'
|
|
|
+ ]);
|
|
|
+ Cache::config('anotherConfigTest', [
|
|
|
+ 'engine' => 'File',
|
|
|
+ 'path' => TMP . 'tests'
|
|
|
+ ]);
|
|
|
+
|
|
|
+ Cache::write('key_1', 'hello', 'configTest');
|
|
|
+ Cache::write('key_2', 'hello again', 'anotherConfigTest');
|
|
|
+
|
|
|
+ $this->assertSame(Cache::read('key_1', 'configTest'), 'hello');
|
|
|
+ $this->assertSame(Cache::read('key_2', 'anotherConfigTest'), 'hello again');
|
|
|
+
|
|
|
+ Cache::clearAll();
|
|
|
+
|
|
|
+ $this->assertFalse(Cache::read('key_1', 'configTest'));
|
|
|
+ $this->assertFalse(Cache::read('key_2', 'anotherConfigTest'));
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Test toggling enabled state of cache.
|