Permalink
Browse files

Test case for DboSource::flushMethodCache

  • Loading branch information...
ovidiupruteanu committed Oct 1, 2013
1 parent f416a32 commit dd3b1e41bc928df0da90063014383065b583227c
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php
@@ -683,6 +683,22 @@ public function testNameMethodCacheCollisions() {
$this->assertEquals($expected, $result);
}
+/**
+ * Test that flushMethodCache works as expected
+ *
+ * @return void
+ */
+ public function testFlushMethodCache() {
+ $this->testDb->cacheMethods = true;
+ $this->testDb->cacheMethod('name','some-key','stuff');
+
+ Cache::write('method_cache', DboTestSource::$methodCache, '_cake_core_');
+
+ $this->testDb->flushMethodCache();
+ $result = $this->testDb->cacheMethod('name','some-key');
+ $this->assertNull($result);
+ }
+
/**
* testLog method
*

0 comments on commit dd3b1e4

Please sign in to comment.