mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Adding skips for cache() and clearCache() if caching is disabled.
This commit is contained in:
parent
326424592d
commit
95555eb1bd
1 changed files with 8 additions and 0 deletions
|
@ -265,6 +265,9 @@ class BasicsTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testCache() {
|
function testCache() {
|
||||||
$_cacheDisable = Configure::read('Cache.disable');
|
$_cacheDisable = Configure::read('Cache.disable');
|
||||||
|
if ($this->skipIf($_cacheDisable, 'Cache is disabled, skipping cache() tests. %s')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Configure::write('Cache.disable', true);
|
Configure::write('Cache.disable', true);
|
||||||
$result = cache('basics_test', 'simple cache write');
|
$result = cache('basics_test', 'simple cache write');
|
||||||
|
@ -297,6 +300,11 @@ class BasicsTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testClearCache() {
|
function testClearCache() {
|
||||||
|
$cacheOff = Configure::read('Cache.disable');
|
||||||
|
if ($this->skipIf($cacheOff, 'Cache is disabled, skipping clearCache() tests. %s')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cache('views' . DS . 'basics_test.cache', 'simple cache write');
|
cache('views' . DS . 'basics_test.cache', 'simple cache write');
|
||||||
$this->assertTrue(file_exists(CACHE . 'views' . DS . 'basics_test.cache'));
|
$this->assertTrue(file_exists(CACHE . 'views' . DS . 'basics_test.cache'));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue