Skip to content

Commit

Permalink
Add extra test case for cache registry setter and update docblock.
Browse files Browse the repository at this point in the history
  • Loading branch information
dakota committed Sep 17, 2015
1 parent 219c872 commit 847cf2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cache/Cache.php
Expand Up @@ -118,7 +118,7 @@ class Cache
* Also allows for injecting of a new registry instance.
*
* @param \Cake\Core\ObjectRegistry $registry Injectable registry object.
* @return \Cake\Cache\CacheRegistry
* @return \Cake\Core\ObjectRegistry
*/
public static function registry(ObjectRegistry $registry = null)
{
Expand Down
14 changes: 14 additions & 0 deletions tests/TestCase/Cache/CacheTest.php
Expand Up @@ -15,6 +15,7 @@
namespace Cake\Test\TestCase\Cache;

use Cake\Cache\Cache;
use Cake\Cache\CacheRegistry;
use Cake\Cache\Engine\FileEngine;
use Cake\Core\App;
use Cake\Core\Configure;
Expand Down Expand Up @@ -569,4 +570,17 @@ public function testRegistry()
{
$this->assertInstanceOf('Cake\Cache\CacheRegistry', Cache::registry());
}

/**
* test registry method setting
*
* @return void
*/
public function testRegistrySet()
{
$registry = new CacheRegistry();
Cache::registry($registry);

$this->assertSame($registry, Cache::registry());
}
}

0 comments on commit 847cf2f

Please sign in to comment.