diff --git a/src/Illuminate/Cache/Repository.php b/src/Illuminate/Cache/Repository.php index de06b9ca9c54..16319a09a9ae 100755 --- a/src/Illuminate/Cache/Repository.php +++ b/src/Illuminate/Cache/Repository.php @@ -419,7 +419,7 @@ public function tags($names) throw new BadMethodCallException('This cache store does not support tagging.'); } - $cache = $this->store->tags($names); + $cache = $this->store->tags(is_array($names) ? $names : func_get_args()); if (! is_null($this->events)) { $cache->setEventDispatcher($this->events); diff --git a/tests/Cache/CacheRepositoryTest.php b/tests/Cache/CacheRepositoryTest.php index f35a20edbb59..f91980120eae 100755 --- a/tests/Cache/CacheRepositoryTest.php +++ b/tests/Cache/CacheRepositoryTest.php @@ -228,6 +228,17 @@ public function testRemovingMultipleKeys() $repo->deleteMultiple(['a-key', 'a-second-key']); } + public function testAllTagsArePassedToTaggableStore() + { + $store = m::mock('Illuminate\Cache\ArrayStore'); + $repo = new \Illuminate\Cache\Repository($store); + + $taggedCache = m::mock(); + $taggedCache->shouldReceive('setDefaultCacheTime'); + $store->shouldReceive('tags')->once()->with(['foo', 'bar', 'baz'])->andReturn($taggedCache); + $repo->tags('foo', 'bar', 'baz'); + } + protected function getRepository() { $dispatcher = new \Illuminate\Events\Dispatcher(m::mock('Illuminate\Container\Container'));