From dd3b1e41bc928df0da90063014383065b583227c Mon Sep 17 00:00:00 2001 From: ovidiupruteanu Date: Tue, 1 Oct 2013 21:34:40 +0300 Subject: [PATCH] Test case for DboSource::flushMethodCache --- .../Test/Case/Model/Datasource/DboSourceTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index 0487f72fe..19290c41a 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -683,6 +683,22 @@ class DboSourceTest extends CakeTestCase { $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 *