mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Removing all uses of the test_suite connection in the test cases
This commit is contained in:
parent
9d2e4b1b04
commit
5c3b4cfcc4
30 changed files with 201 additions and 201 deletions
|
@ -59,7 +59,7 @@ class AclShellTest extends CakeTestCase {
|
|||
$this->_aclDb = Configure::read('Acl.database');
|
||||
$this->_aclClass = Configure::read('Acl.classname');
|
||||
|
||||
Configure::write('Acl.database', 'test_suite');
|
||||
Configure::write('Acl.database', 'test');
|
||||
Configure::write('Acl.classname', 'DbAcl');
|
||||
|
||||
$this->Dispatcher = $this->getMock(
|
||||
|
@ -74,7 +74,7 @@ class AclShellTest extends CakeTestCase {
|
|||
$collection = new ComponentCollection();
|
||||
$this->Task->Acl = new AclComponent($collection);
|
||||
|
||||
$this->Task->params['datasource'] = 'test_suite';
|
||||
$this->Task->params['datasource'] = 'test';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -96,7 +96,7 @@ class BakeShellTest extends CakeTestCase {
|
|||
$this->Shell->View = $this->getMock('ModelTask', array(), array(&$this->Dispatcher));
|
||||
$this->Shell->DbConfig = $this->getMock('DbConfigTask', array(), array(&$this->Dispatcher));
|
||||
|
||||
$this->Shell->DbConfig->expects($this->once())->method('getConfig')->will($this->returnValue('test_suite'));
|
||||
$this->Shell->DbConfig->expects($this->once())->method('getConfig')->will($this->returnValue('test'));
|
||||
|
||||
$this->Shell->Model->expects($this->never())->method('getName');
|
||||
$this->Shell->Model->expects($this->once())->method('bake')->will($this->returnValue(true));
|
||||
|
|
|
@ -54,10 +54,10 @@ class SchemaShellTestSchema extends CakeSchema {
|
|||
/**
|
||||
* connection property
|
||||
*
|
||||
* @var string 'test_suite'
|
||||
* @var string 'test'
|
||||
* @access public
|
||||
*/
|
||||
public $connection = 'test_suite';
|
||||
public $connection = 'test';
|
||||
|
||||
/**
|
||||
* comments property
|
||||
|
@ -165,13 +165,13 @@ class SchemaShellTest extends CakeTestCase {
|
|||
unset($this->Shell->Schema);
|
||||
$this->Shell->params = array(
|
||||
'file' => 'other_file.php',
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'path' => '/test/path'
|
||||
);
|
||||
$this->Shell->startup();
|
||||
$this->assertEqual(strtolower($this->Shell->Schema->name), strtolower(APP_DIR));
|
||||
$this->assertEqual($this->Shell->Schema->file, 'other_file.php');
|
||||
$this->assertEqual($this->Shell->Schema->connection, 'test_suite');
|
||||
$this->assertEqual($this->Shell->Schema->connection, 'test');
|
||||
$this->assertEqual($this->Shell->Schema->path, '/test/path');
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
));
|
||||
$this->Shell->args = array('TestPlugin.TestPluginApp');
|
||||
$this->Shell->params = array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'write' => TMP . 'tests' . DS . 'dump_test.sql'
|
||||
);
|
||||
$this->Shell->startup();
|
||||
|
@ -347,7 +347,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
));
|
||||
$this->Shell->params = array(
|
||||
'plugin' => 'TestPlugin',
|
||||
'connection' => 'test_suite'
|
||||
'connection' => 'test'
|
||||
);
|
||||
$this->Shell->startup();
|
||||
$this->Shell->Schema->path = TMP . 'tests' . DS;
|
||||
|
@ -375,7 +375,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
*/
|
||||
public function testCreateNoArgs() {
|
||||
$this->Shell->params = array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'path' => APP . 'config' . DS . 'sql'
|
||||
);
|
||||
$this->Shell->args = array('i18n');
|
||||
|
@ -383,7 +383,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
|
||||
$this->Shell->create();
|
||||
|
||||
$db = ConnectionManager::getDataSource('test_suite');
|
||||
$db = ConnectionManager::getDataSource('test');
|
||||
$sources = $db->listSources();
|
||||
$this->assertTrue(in_array($db->config['prefix'] . 'i18n', $sources));
|
||||
|
||||
|
@ -398,7 +398,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
*/
|
||||
public function testCreateWithTableArgs() {
|
||||
$this->Shell->params = array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'name' => 'DbAcl',
|
||||
'path' => APP . 'config' . DS . 'schema'
|
||||
);
|
||||
|
@ -423,7 +423,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
*/
|
||||
public function testUpdateWithTable() {
|
||||
$this->Shell->params = array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'f' => true
|
||||
);
|
||||
$this->Shell->args = array('SchemaShellTest', 'articles');
|
||||
|
@ -431,7 +431,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
|
||||
$this->Shell->update();
|
||||
|
||||
$article =& new Model(array('name' => 'Article', 'ds' => 'test_suite'));
|
||||
$article =& new Model(array('name' => 'Article', 'ds' => 'test'));
|
||||
$fields = $article->schema();
|
||||
$this->assertTrue(isset($fields['summary']));
|
||||
|
||||
|
@ -448,7 +448,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
));
|
||||
$this->Shell->params = array(
|
||||
'plugin' => 'TestPlugin',
|
||||
'connection' => 'test_suite'
|
||||
'connection' => 'test'
|
||||
);
|
||||
$this->Shell->startup();
|
||||
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'config' . DS . 'schema';
|
||||
|
@ -467,14 +467,14 @@ class SchemaShellTest extends CakeTestCase {
|
|||
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
||||
));
|
||||
$this->Shell->params = array(
|
||||
'connection' => 'test_suite'
|
||||
'connection' => 'test'
|
||||
);
|
||||
$this->Shell->args = array('TestPlugin.TestPluginApp');
|
||||
$this->Shell->startup();
|
||||
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
|
||||
$this->Shell->create();
|
||||
|
||||
$db =& ConnectionManager::getDataSource('test_suite');
|
||||
$db =& ConnectionManager::getDataSource('test');
|
||||
$sources = $db->listSources();
|
||||
$this->assertTrue(in_array($db->config['prefix'] . 'acos', $sources));
|
||||
|
||||
|
|
|
@ -116,12 +116,12 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testListAll() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->interactive = true;
|
||||
$this->Task->expects($this->at(1))->method('out')->with('1. BakeArticles');
|
||||
$this->Task->expects($this->at(2))->method('out')->with('2. BakeArticlesBakeTags');
|
||||
|
@ -129,7 +129,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
$this->Task->expects($this->at(4))->method('out')->with('4. BakeTags');
|
||||
|
||||
$expected = array('BakeArticles', 'BakeArticlesBakeTags', 'BakeComments', 'BakeTags');
|
||||
$result = $this->Task->listAll('test_suite');
|
||||
$result = $this->Task->listAll('test');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$this->Task->interactive = false;
|
||||
|
@ -145,7 +145,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testGetNameValidIndex() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
@ -153,11 +153,11 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
$this->Task->expects($this->at(5))->method('in')->will($this->returnValue(3));
|
||||
$this->Task->expects($this->at(7))->method('in')->will($this->returnValue(1));
|
||||
|
||||
$result = $this->Task->getName('test_suite');
|
||||
$result = $this->Task->getName('test');
|
||||
$expected = 'BakeComments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->Task->getName('test_suite');
|
||||
$result = $this->Task->getName('test');
|
||||
$expected = 'BakeArticles';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
$this->Task->expects($this->once())->method('err');
|
||||
$this->Task->expects($this->once())->method('_stop');
|
||||
|
||||
$this->Task->getName('test_suite');
|
||||
$this->Task->getName('test');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -417,7 +417,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
*/
|
||||
public function testBakeTest() {
|
||||
$this->Task->plugin = 'ControllerTest';
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->interactive = false;
|
||||
|
||||
$this->Task->Test->expects($this->once())->method('bake')->with('Controller', 'BakeArticles');
|
||||
|
@ -434,12 +434,12 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testInteractive() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
|
||||
$this->Task->expects($this->any())->method('in')
|
||||
|
@ -469,12 +469,12 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testInteractiveAdminMethodsNotInteractive() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->interactive = true;
|
||||
$this->Task->path = '/my/path/';
|
||||
|
||||
|
@ -516,7 +516,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
if ($skip) {
|
||||
return;
|
||||
}
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('all');
|
||||
|
||||
|
@ -543,7 +543,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
if ($skip) {
|
||||
return;
|
||||
}
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('BakeArticles');
|
||||
|
||||
|
@ -579,7 +579,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
if ($skip) {
|
||||
return;
|
||||
}
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array($name);
|
||||
|
||||
|
@ -601,7 +601,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
if ($skip) {
|
||||
return;
|
||||
}
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('BakeArticles', 'public');
|
||||
|
||||
|
@ -625,7 +625,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
return;
|
||||
}
|
||||
$this->Task->Project->expects($this->any())->method('getPrefix')->will($this->returnValue('admin_'));
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('BakeArticles', 'public', 'admin');
|
||||
|
||||
|
@ -648,7 +648,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
return;
|
||||
}
|
||||
$this->Task->Project->expects($this->any())->method('getPrefix')->will($this->returnValue('admin_'));
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('BakeArticles', 'admin');
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
$this->Task->expects($this->at(0))->method('in')
|
||||
->will($this->returnValue('WHERE 1=1 LIMIT 10'));
|
||||
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
|
||||
$result = $this->Task->bake('Article', false, array(
|
||||
|
@ -168,7 +168,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteWithNamedModel() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('article');
|
||||
$filename = '/my/path/article_fixture.php';
|
||||
|
@ -197,7 +197,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteWithNamedModelVariations($modelName) {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
|
||||
$this->Task->args = array($modelName);
|
||||
|
@ -214,7 +214,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteIntoAll() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('all');
|
||||
$this->Task->Model->expects($this->any())->method('listAll')
|
||||
|
@ -237,7 +237,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testAllWithCountAndRecordsFlags() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('all');
|
||||
$this->Task->params = array('count' => 10, 'records' => true);
|
||||
|
@ -263,7 +263,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteInteractive() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
|
||||
$this->Task->expects($this->any())->method('in')->will($this->returnValue('y'));
|
||||
|
@ -285,7 +285,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testBake() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
|
||||
$result = $this->Task->bake('Article');
|
||||
|
@ -320,7 +320,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testRecordGenerationForBinaryAndFloat() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
|
||||
$result = $this->Task->bake('Article', 'datatypes');
|
||||
|
@ -336,7 +336,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testGenerateFixtureFile() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$filename = '/my/path/article_fixture.php';
|
||||
|
||||
|
@ -357,7 +357,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testGeneratePluginFixtureFile() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->plugin = 'TestFixture';
|
||||
$filename = APP . 'plugins' . DS . 'test_fixture' . DS . 'tests' . DS . 'fixtures' . DS . 'article_fixture.php';
|
||||
|
|
|
@ -112,7 +112,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testListAll() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
@ -130,11 +130,11 @@ class ModelTaskTest extends CakeTestCase {
|
|||
$this->Task->expects($this->at(10))->method('out')->with('4. Comment');
|
||||
$this->Task->expects($this->at(11))->method('out')->with('5. Tag');
|
||||
|
||||
$result = $this->Task->listAll('test_suite');
|
||||
$result = $this->Task->listAll('test');
|
||||
$expected = array('articles', 'articles_tags', 'category_threads', 'comments', 'tags');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$result = $this->Task->listAll();
|
||||
$expected = array('articles', 'articles_tags', 'category_threads', 'comments', 'tags');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
@ -148,7 +148,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
public function testGetNameQuit() {
|
||||
$this->Task->expects($this->once())->method('in')->will($this->returnValue('q'));
|
||||
$this->Task->expects($this->once())->method('_stop');
|
||||
$this->Task->getName('test_suite');
|
||||
$this->Task->getName('test');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -157,18 +157,18 @@ class ModelTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testGetNameValidOption() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
||||
$this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls(1, 4));
|
||||
|
||||
$result = $this->Task->getName('test_suite');
|
||||
$result = $this->Task->getName('test');
|
||||
$expected = 'Article';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->Task->getName('test_suite');
|
||||
$result = $this->Task->getName('test');
|
||||
$expected = 'Comment';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
$this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls(99, 1));
|
||||
$this->Task->expects($this->once())->method('err');
|
||||
|
||||
$result = $this->Task->getName('test_suite');
|
||||
$result = $this->Task->getName('test');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -192,7 +192,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
*/
|
||||
public function testGetTableName() {
|
||||
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
|
||||
$result = $this->Task->getTable('Article', 'test_suite');
|
||||
$result = $this->Task->getTable('Article', 'test');
|
||||
$expected = 'articles';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
*/
|
||||
function testGetTableNameCustom() {
|
||||
$this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls('n', 'my_table'));
|
||||
$result = $this->Task->getTable('Article', 'test_suite');
|
||||
$result = $this->Task->getTable('Article', 'test');
|
||||
$expected = 'my_table';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testBelongsToGeneration() {
|
||||
$model = new Model(array('ds' => 'test_suite', 'name' => 'Comment'));
|
||||
$model = new Model(array('ds' => 'test', 'name' => 'Comment'));
|
||||
$result = $this->Task->findBelongsTo($model, array());
|
||||
$expected = array(
|
||||
'belongsTo' => array(
|
||||
|
@ -439,7 +439,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$model = new Model(array('ds' => 'test_suite', 'name' => 'CategoryThread'));
|
||||
$model = new Model(array('ds' => 'test', 'name' => 'CategoryThread'));
|
||||
$result = $this->Task->findBelongsTo($model, array());
|
||||
$expected = array(
|
||||
'belongsTo' => array(
|
||||
|
@ -459,8 +459,8 @@ class ModelTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testHasManyHasOneGeneration() {
|
||||
$model = new Model(array('ds' => 'test_suite', 'name' => 'Article'));
|
||||
$this->Task->connection = 'test_suite';
|
||||
$model = new Model(array('ds' => 'test', 'name' => 'Article'));
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->listAll();
|
||||
$result = $this->Task->findHasOneAndMany($model, array());
|
||||
$expected = array(
|
||||
|
@ -481,7 +481,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$model = new Model(array('ds' => 'test_suite', 'name' => 'CategoryThread'));
|
||||
$model = new Model(array('ds' => 'test', 'name' => 'CategoryThread'));
|
||||
$result = $this->Task->findHasOneAndMany($model, array());
|
||||
$expected = array(
|
||||
'hasOne' => array(
|
||||
|
@ -508,13 +508,13 @@ class ModelTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testHasAndBelongsToManyGeneration() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
||||
$model = new Model(array('ds' => 'test_suite', 'name' => 'Article'));
|
||||
$this->Task->connection = 'test_suite';
|
||||
$model = new Model(array('ds' => 'test', 'name' => 'Article'));
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->listAll();
|
||||
$result = $this->Task->findHasAndBelongsToMany($model, array());
|
||||
$expected = array(
|
||||
|
@ -537,9 +537,9 @@ class ModelTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testDoAssociationsNonInteractive() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->interactive = false;
|
||||
$model = new Model(array('ds' => 'test_suite', 'name' => 'Article'));
|
||||
$model = new Model(array('ds' => 'test', 'name' => 'Article'));
|
||||
$result = $this->Task->doAssociations($model);
|
||||
$expected = array(
|
||||
'hasMany' => array(
|
||||
|
@ -623,7 +623,7 @@ class ModelTaskTest extends CakeTestCase {
|
|||
),
|
||||
)
|
||||
);
|
||||
$model = new Model(array('ds' => 'test_suite', 'name' => 'CategoryThread'));
|
||||
$model = new Model(array('ds' => 'test', 'name' => 'CategoryThread'));
|
||||
|
||||
$this->Task->expects($this->any())->method('in')
|
||||
->will($this->onConsecutiveCalls('n', 'y', 'n', 'n', 'n'));
|
||||
|
@ -774,7 +774,7 @@ STRINGEND;
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteWithNamedModel() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('article');
|
||||
$filename = '/my/path/article.php';
|
||||
|
@ -807,7 +807,7 @@ STRINGEND;
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteWithNamedModelVariations($name) {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->expects($this->once())->method('_checkUnitTest')->will($this->returnValue(1));
|
||||
|
||||
|
@ -825,7 +825,7 @@ STRINGEND;
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteWithNamedModelHasManyCreated() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('article');
|
||||
$filename = '/my/path/article.php';
|
||||
|
@ -843,12 +843,12 @@ STRINGEND;
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteIntoAll() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('all');
|
||||
$this->Task->expects($this->once())->method('_checkUnitTest')->will($this->returnValue(true));
|
||||
|
@ -888,12 +888,12 @@ STRINGEND;
|
|||
* @return void
|
||||
*/
|
||||
function testSkipTablesAndAll() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->args = array('all');
|
||||
$this->Task->expects($this->once())->method('_checkUnitTest')->will($this->returnValue(true));
|
||||
|
@ -927,12 +927,12 @@ STRINGEND;
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteIntoInteractive() {
|
||||
$count = count($this->Task->listAll('test_suite'));
|
||||
$count = count($this->Task->listAll('test'));
|
||||
if ($count != count($this->fixtures)) {
|
||||
$this->markTestSkipped('Additional tables detected.');
|
||||
}
|
||||
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
$this->Task->interactive = true;
|
||||
|
||||
|
@ -969,7 +969,7 @@ STRINGEND;
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteWithNonExistantTableName() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->path = '/my/path/';
|
||||
|
||||
$this->Task->expects($this->once())->method('_stop');
|
||||
|
|
|
@ -613,7 +613,7 @@ class ViewTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteInteractive() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->args = array();
|
||||
$this->Task->params = array();
|
||||
|
||||
|
@ -658,7 +658,7 @@ class ViewTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testExecuteWithAlternateTemplates() {
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->args = array('ViewTaskComments', 'index', 'list');
|
||||
$this->Task->params = array();
|
||||
|
||||
|
@ -677,7 +677,7 @@ class ViewTaskTest extends CakeTestCase {
|
|||
*/
|
||||
public function testExecuteInteractiveWithAdmin() {
|
||||
Configure::write('Routing.prefixes', array('admin'));
|
||||
$this->Task->connection = 'test_suite';
|
||||
$this->Task->connection = 'test';
|
||||
$this->Task->args = array();
|
||||
|
||||
$this->Task->Controller->expects($this->once())->method('getName')
|
||||
|
|
|
@ -49,7 +49,7 @@ class AllTests extends PHPUnit_Framework_TestSuite {
|
|||
//$suite->addTestFile($path . 'all_model.test.php');
|
||||
$suite->addTestFile($path . 'all_routing.test.php');
|
||||
$suite->addTestFile($path . 'all_socket.test.php');
|
||||
//$suite->addTestFile($path . 'all_test_suite.test.php');;
|
||||
//$suite->addTestFile($path . 'all_test.test.php');;
|
||||
$suite->addTestFile($path . 'all_views.test.php');
|
||||
$suite->addTestFile($path . 'all_xml.test.php');
|
||||
return $suite;
|
||||
|
|
|
@ -116,7 +116,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
$_SESSION = null;
|
||||
|
||||
Configure::write('Session', array(
|
||||
'cookie' => 'test_suite',
|
||||
'cookie' => 'test',
|
||||
'checkAgent' => false,
|
||||
'timeout' => 86400,
|
||||
'ini' => array(
|
||||
|
@ -127,7 +127,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
TestCakeSession::start();
|
||||
$this->assertEquals('', ini_get('session.use_trans_sid'), 'Ini value is incorrect');
|
||||
$this->assertEquals('example.com', ini_get('session.referer_check'), 'Ini value is incorrect');
|
||||
$this->assertEquals('test_suite', ini_get('session.name'), 'Ini value is incorrect');
|
||||
$this->assertEquals('test', ini_get('session.name'), 'Ini value is incorrect');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -682,7 +682,7 @@ class CakeSessionTest extends CakeTestCase {
|
|||
Configure::write('Session.defaults', 'database');
|
||||
Configure::write('Session.handler.table', 'sessions');
|
||||
Configure::write('Session.handler.model', 'Session');
|
||||
Configure::write('Session.handler.database', 'test_suite');
|
||||
Configure::write('Session.handler.database', 'test');
|
||||
|
||||
TestCakeSession::init();
|
||||
TestCakeSession::start();
|
||||
|
|
|
@ -84,7 +84,7 @@ class CakeTestFixtureImportFixture extends CakeTestFixture {
|
|||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public $import = array('table' => 'fixture_tests', 'connection' => 'fixture_test_suite');
|
||||
public $import = array('table' => 'fixture_tests', 'connection' => 'fixture_test');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,14 +112,14 @@ class CakeTestFixtureDefaultImportFixture extends CakeTestFixture {
|
|||
class FixtureImportTestModel extends Model {
|
||||
public $name = 'FixtureImport';
|
||||
public $useTable = 'fixture_tests';
|
||||
public $useDbConfig = 'test_suite';
|
||||
public $useDbConfig = 'test';
|
||||
}
|
||||
|
||||
class FixturePrefixTest extends Model {
|
||||
public $name = 'FixturePrefix';
|
||||
public $useTable = '_tests';
|
||||
public $tablePrefix = 'fixture';
|
||||
public $useDbConfig = 'test_suite';
|
||||
public $useDbConfig = 'test';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -141,9 +141,9 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
$this->criticDb->fullDebug = true;
|
||||
|
||||
$dbs = ConnectionManager::enumConnectionObjects();
|
||||
if (!isset($dbs['test_suite'])) {
|
||||
if (!isset($dbs['test'])) {
|
||||
$db = ConnectionManager::getDatasource('test');
|
||||
ConnectionManager::create('test_suite', $db->config);
|
||||
ConnectionManager::create('test', $db->config);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testInitDbPrefix() {
|
||||
$db = ConnectionManager::getDataSource('test_suite');
|
||||
$db = ConnectionManager::getDataSource('test');
|
||||
$Source = new CakeTestFixtureTestFixture();
|
||||
$Source->drop($db);
|
||||
$Source->create($db);
|
||||
|
@ -194,18 +194,18 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
$this->assertEqual(array_keys($Fixture->fields), $expected);
|
||||
|
||||
$config = $db->config;
|
||||
$config['prefix'] = 'fixture_test_suite_';
|
||||
ConnectionManager::create('fixture_test_suite', $config);
|
||||
$config['prefix'] = 'fixture_test_';
|
||||
ConnectionManager::create('fixture_test', $config);
|
||||
|
||||
$Fixture->fields = $Fixture->records = null;
|
||||
$Fixture->import = array('table' => 'fixture_tests', 'connection' => 'test_suite', 'records' => true);
|
||||
$Fixture->import = array('table' => 'fixture_tests', 'connection' => 'test', 'records' => true);
|
||||
$Fixture->init();
|
||||
$this->assertEqual(count($Fixture->records), count($Source->records));
|
||||
$Fixture->create(ConnectionManager::getDataSource('fixture_test_suite'));
|
||||
$Fixture->create(ConnectionManager::getDataSource('fixture_test'));
|
||||
|
||||
$Fixture =& new CakeTestFixtureImportFixture();
|
||||
$Fixture->fields = $Fixture->records = $Fixture->table = null;
|
||||
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'test_suite');
|
||||
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'test');
|
||||
$Fixture->init();
|
||||
$this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created'));
|
||||
$this->assertEqual($Fixture->table, 'fixture_tests');
|
||||
|
@ -213,7 +213,7 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
$keys = array_flip(ClassRegistry::keys());
|
||||
$this->assertFalse(array_key_exists('fixtureimporttestmodel', $keys));
|
||||
|
||||
$Fixture->drop(ConnectionManager::getDataSource('fixture_test_suite'));
|
||||
$Fixture->drop(ConnectionManager::getDataSource('fixture_test'));
|
||||
$Source->drop($db);
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
|
||||
$Fixture =& new CakeTestFixtureImportFixture();
|
||||
$Fixture->fields = $Fixture->records = $Fixture->table = null;
|
||||
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'test_suite');
|
||||
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'test');
|
||||
|
||||
$Fixture->init();
|
||||
$this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created'));
|
||||
|
@ -261,7 +261,7 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
$Fixture =& new CakeTestFixtureTestFixture();
|
||||
unset($Fixture->table);
|
||||
$Fixture->fields = $Fixture->records = null;
|
||||
$Fixture->import = array('model' => 'FixturePrefixTest', 'connection' => 'test_suite', 'records' => false);
|
||||
$Fixture->import = array('model' => 'FixturePrefixTest', 'connection' => 'test', 'records' => false);
|
||||
$Fixture->init();
|
||||
$this->assertEqual($Fixture->table, 'fixture_tests');
|
||||
|
||||
|
@ -279,11 +279,11 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
*/
|
||||
function testImport() {
|
||||
$defaultDb = ConnectionManager::getDataSource('default');
|
||||
$testSuiteDb = ConnectionManager::getDataSource('test_suite');
|
||||
$testSuiteDb = ConnectionManager::getDataSource('test');
|
||||
$defaultConfig = $defaultDb->config;
|
||||
$testSuiteConfig = $testSuiteDb->config;
|
||||
ConnectionManager::create('new_test_suite', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix'])));
|
||||
$newTestSuiteDb = ConnectionManager::getDataSource('new_test_suite');
|
||||
ConnectionManager::create('new_test', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix'])));
|
||||
$newTestSuiteDb = ConnectionManager::getDataSource('new_test');
|
||||
|
||||
$Source = new CakeTestFixtureTestFixture();
|
||||
$Source->create($newTestSuiteDb);
|
||||
|
@ -293,7 +293,7 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
|
||||
$Fixture = new CakeTestFixtureDefaultImportFixture();
|
||||
$Fixture->fields = $Fixture->records = null;
|
||||
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'new_test_suite');
|
||||
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'new_test');
|
||||
$Fixture->init();
|
||||
$this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created'));
|
||||
|
||||
|
@ -314,11 +314,11 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
function testImportWithRecords() {
|
||||
|
||||
$defaultDb = ConnectionManager::getDataSource('default');
|
||||
$testSuiteDb = ConnectionManager::getDataSource('test_suite');
|
||||
$testSuiteDb = ConnectionManager::getDataSource('test');
|
||||
$defaultConfig = $defaultDb->config;
|
||||
$testSuiteConfig = $testSuiteDb->config;
|
||||
ConnectionManager::create('new_test_suite', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix'])));
|
||||
$newTestSuiteDb = ConnectionManager::getDataSource('new_test_suite');
|
||||
ConnectionManager::create('new_test', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix'])));
|
||||
$newTestSuiteDb = ConnectionManager::getDataSource('new_test');
|
||||
|
||||
$Source = new CakeTestFixtureTestFixture();
|
||||
$Source->create($newTestSuiteDb);
|
||||
|
@ -329,7 +329,7 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|||
$Fixture = new CakeTestFixtureDefaultImportFixture();
|
||||
$Fixture->fields = $Fixture->records = null;
|
||||
$Fixture->import = array(
|
||||
'model' => 'FixtureImportTestModel', 'connection' => 'new_test_suite', 'records' => true
|
||||
'model' => 'FixtureImportTestModel', 'connection' => 'new_test', 'records' => true
|
||||
);
|
||||
$Fixture->init();
|
||||
$this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created'));
|
||||
|
|
|
@ -30,10 +30,10 @@ class AclNodeTwoTestBase extends AclNode {
|
|||
/**
|
||||
* useDbConfig property
|
||||
*
|
||||
* @var string 'test_suite'
|
||||
* @var string 'test'
|
||||
* @access public
|
||||
*/
|
||||
public $useDbConfig = 'test_suite';
|
||||
public $useDbConfig = 'test';
|
||||
|
||||
/**
|
||||
* cacheSources property
|
||||
|
@ -356,7 +356,7 @@ class DbAclTest extends CakeTestCase {
|
|||
$this->_settings = Configure::read('Acl');
|
||||
|
||||
Configure::write('Acl.classname', 'DbAclTwoTest');
|
||||
Configure::write('Acl.database', 'test_suite');
|
||||
Configure::write('Acl.database', 'test');
|
||||
$Collection = new ComponentCollection();
|
||||
$this->Acl = new AclComponent($Collection);
|
||||
}
|
||||
|
|
|
@ -76,10 +76,10 @@ class AuthUser extends CakeTestModel {
|
|||
/**
|
||||
* useDbConfig property
|
||||
*
|
||||
* @var string 'test_suite'
|
||||
* @var string 'test'
|
||||
* @access public
|
||||
*/
|
||||
public $useDbConfig = 'test_suite';
|
||||
public $useDbConfig = 'test';
|
||||
|
||||
/**
|
||||
* parentNode method
|
||||
|
@ -155,10 +155,10 @@ class UuidUser extends CakeTestModel {
|
|||
/**
|
||||
* useDbConfig property
|
||||
*
|
||||
* @var string 'test_suite'
|
||||
* @var string 'test'
|
||||
* @access public
|
||||
*/
|
||||
public $useDbConfig = 'test_suite';
|
||||
public $useDbConfig = 'test';
|
||||
|
||||
/**
|
||||
* useTable property
|
||||
|
@ -488,7 +488,7 @@ class AuthTest extends CakeTestCase {
|
|||
Configure::write('Security.cipherSeed', 770011223369876);
|
||||
|
||||
$this->_acl = Configure::read('Acl');
|
||||
Configure::write('Acl.database', 'test_suite');
|
||||
Configure::write('Acl.database', 'test');
|
||||
Configure::write('Acl.classname', 'DbAcl');
|
||||
|
||||
$request = new CakeRequest(null, false);
|
||||
|
|
|
@ -99,7 +99,7 @@ class SessionComponentTest extends CakeTestCase {
|
|||
Configure::write('Session', array(
|
||||
'defaults' => 'php',
|
||||
'timeout' => 100,
|
||||
'cookie' => 'test_suite'
|
||||
'cookie' => 'test'
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ class AclBehaviorTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function setUp() {
|
||||
Configure::write('Acl.database', 'test_suite');
|
||||
Configure::write('Acl.database', 'test');
|
||||
|
||||
$this->Aco = new Aco();
|
||||
$this->Aro = new Aro();
|
||||
|
|
|
@ -39,10 +39,10 @@ class MyAppSchema extends CakeSchema {
|
|||
/**
|
||||
* connection property
|
||||
*
|
||||
* @var string 'test_suite'
|
||||
* @var string 'test'
|
||||
* @access public
|
||||
*/
|
||||
public $connection = 'test_suite';
|
||||
public $connection = 'test';
|
||||
|
||||
/**
|
||||
* comments property
|
||||
|
@ -563,7 +563,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
*/
|
||||
function testSchemaRead() {
|
||||
$read = $this->Schema->read(array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'name' => 'TestApp',
|
||||
'models' => array('SchemaPost', 'SchemaComment', 'SchemaTag', 'SchemaDatatype')
|
||||
));
|
||||
|
@ -582,7 +582,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
$this->Schema->tables['datatypes']['float_field']
|
||||
);
|
||||
|
||||
$db =& ConnectionManager::getDataSource('test_suite');
|
||||
$db =& ConnectionManager::getDataSource('test');
|
||||
$config = $db->config;
|
||||
$config['prefix'] = 'schema_test_prefix_';
|
||||
ConnectionManager::create('schema_prefix', $config);
|
||||
|
@ -593,14 +593,14 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
$SchemaPost->table = 'sts';
|
||||
$SchemaPost->tablePrefix = 'po';
|
||||
$read = $this->Schema->read(array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'name' => 'TestApp',
|
||||
'models' => array('SchemaPost')
|
||||
));
|
||||
$this->assertFalse(isset($read['tables']['missing']['posts']), 'Posts table was not read from tablePrefix %s');
|
||||
|
||||
$read = $this->Schema->read(array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'name' => 'TestApp',
|
||||
'models' => array('SchemaComment', 'SchemaTag', 'SchemaPost')
|
||||
));
|
||||
|
@ -617,7 +617,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
|
||||
$Schema =& new CakeSchema();
|
||||
$read = $Schema->read(array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'name' => 'TestApp',
|
||||
'models' => array('SchemaPrefixAuthUser')
|
||||
));
|
||||
|
@ -640,7 +640,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
$Schema =& new CakeSchema();
|
||||
$Schema->plugin = 'TestPlugin';
|
||||
$read = $Schema->read(array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'name' => 'TestApp',
|
||||
'models' => true
|
||||
));
|
||||
|
@ -677,7 +677,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
$fixture->insert($db2);
|
||||
|
||||
$read = $this->Schema->read(array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'name' => 'TestApp',
|
||||
'models' => array('SchemaCrossDatabase', 'SchemaPost')
|
||||
));
|
||||
|
@ -942,11 +942,11 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testSchemaCreateTable() {
|
||||
$db =& ConnectionManager::getDataSource('test_suite');
|
||||
$db =& ConnectionManager::getDataSource('test');
|
||||
$db->cacheSources = false;
|
||||
|
||||
$Schema =& new CakeSchema(array(
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'testdescribes' => array(
|
||||
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||
'int_null' => array('type' => 'integer', 'null' => true),
|
||||
|
|
|
@ -67,7 +67,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
$sources = ConnectionManager::enumConnectionObjects();
|
||||
$this->assertTrue(count($sources) >= 1);
|
||||
|
||||
$connections = array('default', 'test', 'test_suite');
|
||||
$connections = array('default', 'test', 'test');
|
||||
$this->assertTrue(count(array_intersect(array_keys($sources), $connections)) >= 1);
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
$sources = ConnectionManager::sourceList();
|
||||
$this->assertTrue(count($sources) >= 1);
|
||||
|
||||
$connections = array('default', 'test', 'test_suite');
|
||||
$connections = array('default', 'test', 'test');
|
||||
$this->assertTrue(count(array_intersect($sources, $connections)) >= 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -328,7 +328,7 @@ class DboMssqlTest extends CakeTestCase {
|
|||
*
|
||||
*/
|
||||
public function setUp() {
|
||||
$db = ConnectionManager::getDataSource('test_suite');
|
||||
$db = ConnectionManager::getDataSource('test');
|
||||
$this->db = new DboMssqlTestDb($db->config);
|
||||
$this->model = new MssqlTestModel();
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
*
|
||||
*/
|
||||
public function setUp() {
|
||||
$this->Dbo = ConnectionManager::getDataSource('test_suite');
|
||||
$this->Dbo = ConnectionManager::getDataSource('test');
|
||||
if ($this->Dbo->config['driver'] !== 'mysql') {
|
||||
$this->markTestSkipped('The MySQL extension is not available.');
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
$this->Dbo->query('CREATE TABLE ' . $this->Dbo->fullTableName($tableName) . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id));');
|
||||
|
||||
$this->model = new CakeTestModel(array(
|
||||
'name' => 'Tinyint', 'table' => $tableName, 'ds' => 'test_suite'
|
||||
'name' => 'Tinyint', 'table' => $tableName, 'ds' => 'test'
|
||||
));
|
||||
|
||||
$result = $this->model->schema();
|
||||
|
@ -561,7 +561,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
|
||||
$schema1 = new CakeSchema(array(
|
||||
'name' => 'AlterTest1',
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'altertest' => array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => 0),
|
||||
'name' => array('type' => 'string', 'null' => false, 'length' => 50),
|
||||
|
@ -572,7 +572,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
|
||||
$schema2 = new CakeSchema(array(
|
||||
'name' => 'AlterTest2',
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'altertest' => array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => 0),
|
||||
'name' => array('type' => 'string', 'null' => false, 'length' => 50),
|
||||
|
@ -592,7 +592,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
// Change three indexes, delete one and add another one
|
||||
$schema3 = new CakeSchema(array(
|
||||
'name' => 'AlterTest3',
|
||||
'connection' => 'test_suite',
|
||||
'connection' => 'test',
|
||||
'altertest' => array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => 0),
|
||||
'name' => array('type' => 'string', 'null' => false, 'length' => 50),
|
||||
|
@ -633,7 +633,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
|