mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
95522fa3a9
commit
a0ff55926c
2 changed files with 7 additions and 3 deletions
|
@ -162,7 +162,7 @@ class CakeTestCase extends UnitTestCase {
|
||||||
foreach ($classRegistry->__map as $key => $name) {
|
foreach ($classRegistry->__map as $key => $name) {
|
||||||
$object =& $classRegistry->getObject(Inflector::camelize($key));
|
$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)) {
|
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,
|
'table' => $object->table,
|
||||||
'model' => $object->alias,
|
'model' => $object->alias,
|
||||||
'key' => Inflector::camelize($key));
|
'key' => Inflector::camelize($key));
|
||||||
|
@ -173,7 +173,8 @@ class CakeTestCase extends UnitTestCase {
|
||||||
$this->_queries = array(
|
$this->_queries = array(
|
||||||
'create' => array(),
|
'create' => array(),
|
||||||
'insert' => array(),
|
'insert' => array(),
|
||||||
'drop' => array());
|
'drop' => array()
|
||||||
|
);
|
||||||
|
|
||||||
foreach ($models as $model) {
|
foreach ($models as $model) {
|
||||||
$fixture =& new CakeTestFixture($this->db);
|
$fixture =& new CakeTestFixture($this->db);
|
||||||
|
@ -374,10 +375,12 @@ class CakeTestCase extends UnitTestCase {
|
||||||
$this->db->cacheSources = false;
|
$this->db->cacheSources = false;
|
||||||
$sources = $this->db->listSources();
|
$sources = $this->db->listSources();
|
||||||
$this->db->cacheSources = $cacheSources;
|
$this->db->cacheSources = $cacheSources;
|
||||||
|
|
||||||
foreach ($this->_fixtures as $fixture) {
|
foreach ($this->_fixtures as $fixture) {
|
||||||
if (in_array($fixture->table, $sources)) {
|
if (in_array($fixture->table, $sources)) {
|
||||||
$fixture->drop($this->db);
|
$fixture->drop($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fixture->create($this->db);
|
$fixture->create($this->db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ class CakeTestFixture extends Object {
|
||||||
*/
|
*/
|
||||||
function __construct(&$db) {
|
function __construct(&$db) {
|
||||||
App::import('Model', 'Schema');
|
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();
|
$this->init();
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,7 @@ class CakeTestFixture extends Object {
|
||||||
|
|
||||||
if (isset($import['model']) && (class_exists($import['model']) || App::import('Model', $import['model']))) {
|
if (isset($import['model']) && (class_exists($import['model']) || App::import('Model', $import['model']))) {
|
||||||
$model =& new $import['model'];
|
$model =& new $import['model'];
|
||||||
|
|
||||||
$db =& ConnectionManager::getDataSource($model->useDbConfig);
|
$db =& ConnectionManager::getDataSource($model->useDbConfig);
|
||||||
$db->cacheSources = false;
|
$db->cacheSources = false;
|
||||||
$this->fields = $model->schema(true);
|
$this->fields = $model->schema(true);
|
||||||
|
|
Loading…
Reference in a new issue