small formatting issues

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7235 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
DarkAngelBGE 2008-06-22 14:28:45 +00:00
parent 95522fa3a9
commit a0ff55926c
2 changed files with 7 additions and 3 deletions

View file

@ -162,7 +162,7 @@ class CakeTestCase extends UnitTestCase {
foreach ($classRegistry->__map as $key => $name) {
$object =& $classRegistry->getObject(Inflector::camelize($key));
if (is_subclass_of($object, 'Model') && ((is_array($params['fixturize']) && in_array($object->alias, $params['fixturize'])) || $params['fixturize'] === true)) {
$models[$object->alias] = array (
$models[$object->alias] = array(
'table' => $object->table,
'model' => $object->alias,
'key' => Inflector::camelize($key));
@ -173,7 +173,8 @@ class CakeTestCase extends UnitTestCase {
$this->_queries = array(
'create' => array(),
'insert' => array(),
'drop' => array());
'drop' => array()
);
foreach ($models as $model) {
$fixture =& new CakeTestFixture($this->db);
@ -374,10 +375,12 @@ class CakeTestCase extends UnitTestCase {
$this->db->cacheSources = false;
$sources = $this->db->listSources();
$this->db->cacheSources = $cacheSources;
foreach ($this->_fixtures as $fixture) {
if (in_array($fixture->table, $sources)) {
$fixture->drop($this->db);
}
$fixture->create($this->db);
}
}

View file

@ -55,7 +55,7 @@ class CakeTestFixture extends Object {
*/
function __construct(&$db) {
App::import('Model', 'Schema');
$this->Schema = new CakeSchema(array('name'=>'TestSuite', 'connection'=>'test_suite'));
$this->Schema = new CakeSchema(array('name' => 'TestSuite', 'connection' => 'test_suite'));
$this->init();
}
@ -79,6 +79,7 @@ class CakeTestFixture extends Object {
if (isset($import['model']) && (class_exists($import['model']) || App::import('Model', $import['model']))) {
$model =& new $import['model'];
$db =& ConnectionManager::getDataSource($model->useDbConfig);
$db->cacheSources = false;
$this->fields = $model->schema(true);