fixing issue in schema when model does not use a table. updating cache test to properly test Cache::set()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7592 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-09-11 13:35:11 +00:00
parent 0df14f183f
commit 970ef7dc56
2 changed files with 6 additions and 13 deletions

View file

@ -205,7 +205,7 @@ class CakeSchema extends Object {
$Object =& ClassRegistry::init(array('class' => $model, 'ds' => $connection)); $Object =& ClassRegistry::init(array('class' => $model, 'ds' => $connection));
} }
if (is_object($Object)) { if (is_object($Object) && $Object->useTable !== false) {
$Object->setDataSource($connection); $Object->setDataSource($connection);
$table = $db->fullTableName($Object, false); $table = $db->fullTableName($Object, false);

View file

@ -159,24 +159,17 @@ class CacheTest extends CakeTestCase {
Cache::set(array('duration' => '+1 year')); Cache::set(array('duration' => '+1 year'));
$data = Cache::read('test_cache'); $data = Cache::read('test_cache');
if($data === false) { $this->assertFalse($data);
$data = 'this is just a simple test of the cache system'; $data = 'this is just a simple test of the cache system';
$write = Cache::write('test_cache', $data); $write = Cache::write('test_cache', $data);
}
$this->assertTrue($write); $this->assertTrue($write);
$write = false;
Cache::set(array('duration' => '+1 year')); Cache::set(array('duration' => '+1 year'));
$data = Cache::read('test_cache'); $data = Cache::read('test_cache');
if($data === false) {
$data = 'this is just a simple test of the cache system';
$write = Cache::write('test_cache', $data);
}
$this->assertFalse($write); $this->assertEqual($data, 'this is just a simple test of the cache system');
Cache::delete('test_cache'); Cache::delete('test_cache');