Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added test for ticket #469

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
commit 6d13f0d3d1006f91ffd7d8ea09dea03483af3d7d 1 parent 0cc1e4c
@ceeram ceeram authored markstory committed
Showing with 17 additions and 0 deletions.
  1. +17 −0 cake/tests/cases/basics.test.php
View
17 cake/tests/cases/basics.test.php
@@ -332,6 +332,23 @@ function testClearCache() {
$this->assertFalse(file_exists(CACHE . 'models' . DS . 'basics_test.cache'));
$this->assertFalse(file_exists(CACHE . 'models' . DS . 'basics_test_2.cache'));
$this->assertFalse(file_exists(CACHE . 'models' . DS . 'basics_test_3.cache'));
+
+ // checking if empty files were not removed
+ $emptyExists = file_exists(CACHE . 'views' . DS . 'empty');
+ if (!$emptyExists) {
+ cache('views' . DS . 'empty', '');
+ }
+ cache('views' . DS . 'basics_test.php', 'simple cache write');
+ $this->assertTrue(file_exists(CACHE . 'views' . DS . 'basics_test.php'));
+ $this->assertTrue(file_exists(CACHE . 'views' . DS . 'empty'));
+
+ $result = clearCache();
+ $this->assertTrue($result);
+ $this->assertTrue(file_exists(CACHE . 'views' . DS . 'empty'));
+ $this->assertFalse(file_exists(CACHE . 'views' . DS . 'basics_test.php'));
+ if (!$emptyExists) {
+ unlink(CACHE . 'views' . DS . 'empty');
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.