From cfc10a7c689189dc0ab665e3cf6f74a320d7c663 Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 4 Mar 2013 22:37:48 -0500 Subject: [PATCH] Fix failing test and unskip tests in SchemaShell::create() The tests were accidentally skipped when tests for --exclude were added & fixed. Restore the gist of the previous tests. --- .../Case/Console/Command/SchemaShellTest.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php index 422cf2b01..985c18dde 100644 --- a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php @@ -404,6 +404,7 @@ class SchemaShellTest extends CakeTestCase { * @return void */ public function testGenerateExclude() { + Configure::write('Acl.database', 'test'); $this->db->cacheSources = false; $this->Shell->params = array( 'connection' => 'test', @@ -456,15 +457,15 @@ class SchemaShellTest extends CakeTestCase { public function testCreateWithTableArgs() { $db = ConnectionManager::getDataSource('test'); $sources = $db->listSources(); - if (in_array('acos', $sources)) { - $this->markTestSkipped('acos table already exists, cannot try to create it again.'); + if (in_array('i18n', $sources)) { + $this->markTestSkipped('i18n table already exists, cannot try to create it again.'); } $this->Shell->params = array( 'connection' => 'test', - 'name' => 'DbAcl', + 'name' => 'I18n', 'path' => APP . 'Config' . DS . 'Schema' ); - $this->Shell->args = array('DbAcl', 'acos'); + $this->Shell->args = array('I18n', 'i18n'); $this->Shell->startup(); $this->Shell->expects($this->any())->method('in')->will($this->returnValue('y')); $this->Shell->create(); @@ -472,12 +473,10 @@ class SchemaShellTest extends CakeTestCase { $db = ConnectionManager::getDataSource('test'); $db->cacheSources = false; $sources = $db->listSources(); - $this->assertTrue(in_array($db->config['prefix'] . 'acos', $sources), 'acos should be present.'); - $this->assertFalse(in_array($db->config['prefix'] . 'aros', $sources), 'aros should not be found.'); - $this->assertFalse(in_array('aros_acos', $sources), 'aros_acos should not be found.'); + $this->assertTrue(in_array($db->config['prefix'] . 'i18n', $sources), 'i18n should be present.'); - $schema = new DbAclSchema(); - $db->execute($db->dropSchema($schema, 'acos')); + $schema = new I18nSchema(); + $db->execute($db->dropSchema($schema, 'i18n')); } /**