From 4cf05205d4c10200e978040ea4df350ab1a9e857 Mon Sep 17 00:00:00 2001 From: Panagiotis Moustafellos Date: Tue, 29 Oct 2013 00:18:22 +0200 Subject: [PATCH] added cache mset() base test --- tests/unit/framework/caching/CacheTestCase.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/unit/framework/caching/CacheTestCase.php b/tests/unit/framework/caching/CacheTestCase.php index 9ff6409..fc84cf1 100644 --- a/tests/unit/framework/caching/CacheTestCase.php +++ b/tests/unit/framework/caching/CacheTestCase.php @@ -92,6 +92,25 @@ abstract class CacheTestCase extends TestCase $this->assertEquals('array_test', $array['array_test']); } + public function testMset() + { + $cache = $this->getCacheInstance(); + $cache->flush(); + + $this->assertTrue($cache->mset(['string_test' => 'string_test', + 'number_test' => 42, + 'array_test' => ['array_test' => 'array_test'], + ])); + + $this->assertEquals('string_test', $cache->get('string_test')); + + $this->assertEquals(42, $cache->get('number_test')); + + $array = $cache->get('array_test'); + $this->assertArrayHasKey('array_test', $array); + $this->assertEquals('array_test', $array['array_test']); + } + public function testExists() { $cache = $this->prepare();