|
@@ -946,6 +946,28 @@ class DboSourceTest extends CakeTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * test that fields() method cache detects schema name changes
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ */
|
|
|
|
|
+ public function testFieldsCacheKeyWithSchemanameChange() {
|
|
|
|
|
+ Cache::delete('method_cache', '_cake_core_');
|
|
|
|
|
+ DboSource::$methodCache = array();
|
|
|
|
|
+ $Article = ClassRegistry::init('Article');
|
|
|
|
|
+
|
|
|
|
|
+ $ds = $Article->getDataSource();
|
|
|
|
|
+ $ds->cacheMethods = true;
|
|
|
|
|
+ $first = $ds->fields($Article);
|
|
|
|
|
+
|
|
|
|
|
+ $Article->schemaName = 'secondSchema';
|
|
|
|
|
+ $ds = $Article->getDataSource();
|
|
|
|
|
+ $ds->cacheMethods = true;
|
|
|
|
|
+ $second = $ds->fields($Article);
|
|
|
|
|
+
|
|
|
|
|
+ $this->assertEquals(2, count(DboSource::$methodCache['fields']));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
* Test that group works without a model
|
|
* Test that group works without a model
|
|
|
*
|
|
*
|
|
|
* @return void
|
|
* @return void
|