Skip to content

Commit

Permalink
Add tests for the return of Cache::clearAll().
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 27, 2016
1 parent 36a5661 commit b87b73c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/TestCase/Cache/CacheTest.php
Expand Up @@ -556,7 +556,7 @@ public function testCacheDisable()
Cache::enable();
Cache::clear(false, 'test_cache_disable_2');
}

/**
* test clearAll() method
*
Expand All @@ -572,17 +572,20 @@ public function testClearAll()
'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();


$result = Cache::clearAll();
$this->assertTrue($result['configTest']);
$this->assertTrue($result['anotherConfigTest']);
$this->assertFalse(Cache::read('key_1', 'configTest'));
$this->assertFalse(Cache::read('key_2', 'anotherConfigTest'));
Cache::drop('configTest');
Cache::drop('anotherConfigTest');
}

/**
Expand Down

0 comments on commit b87b73c

Please sign in to comment.