Browse Source

Add test for cache instances and group config

Walther Lalk 9 years ago
parent
commit
be4cebef30
1 changed files with 18 additions and 0 deletions
  1. 18 0
      tests/TestCase/Cache/CacheTest.php

+ 18 - 0
tests/TestCase/Cache/CacheTest.php

@@ -354,6 +354,24 @@ class CacheTest extends TestCase
     }
 
     /**
+     * testGroupConfigsWithCacheInstance method
+     */
+    public function testGroupConfigsWithCacheInstance()
+    {
+        Cache::drop('test');
+        $cache = new FileEngine();
+        $cache->init([
+            'duration' => 300,
+            'engine' => 'File',
+            'groups' => ['users', 'comments'],
+        ]);
+        Cache::config('cached', $cache);
+
+        $result = Cache::groupConfigs('users');
+        $this->assertEquals(['users' => ['cached']], $result);
+    }
+
+    /**
      * testGroupConfigsThrowsException method
      * @expectedException \InvalidArgumentException
      */