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.
This commit is contained in:
mark_story 2013-03-04 22:37:48 -05:00
parent 4a0df83783
commit cfc10a7c68

View file

@ -404,6 +404,7 @@ class SchemaShellTest extends CakeTestCase {
* @return void * @return void
*/ */
public function testGenerateExclude() { public function testGenerateExclude() {
Configure::write('Acl.database', 'test');
$this->db->cacheSources = false; $this->db->cacheSources = false;
$this->Shell->params = array( $this->Shell->params = array(
'connection' => 'test', 'connection' => 'test',
@ -456,15 +457,15 @@ class SchemaShellTest extends CakeTestCase {
public function testCreateWithTableArgs() { public function testCreateWithTableArgs() {
$db = ConnectionManager::getDataSource('test'); $db = ConnectionManager::getDataSource('test');
$sources = $db->listSources(); $sources = $db->listSources();
if (in_array('acos', $sources)) { if (in_array('i18n', $sources)) {
$this->markTestSkipped('acos table already exists, cannot try to create it again.'); $this->markTestSkipped('i18n table already exists, cannot try to create it again.');
} }
$this->Shell->params = array( $this->Shell->params = array(
'connection' => 'test', 'connection' => 'test',
'name' => 'DbAcl', 'name' => 'I18n',
'path' => APP . 'Config' . DS . 'Schema' 'path' => APP . 'Config' . DS . 'Schema'
); );
$this->Shell->args = array('DbAcl', 'acos'); $this->Shell->args = array('I18n', 'i18n');
$this->Shell->startup(); $this->Shell->startup();
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y')); $this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
$this->Shell->create(); $this->Shell->create();
@ -472,12 +473,10 @@ class SchemaShellTest extends CakeTestCase {
$db = ConnectionManager::getDataSource('test'); $db = ConnectionManager::getDataSource('test');
$db->cacheSources = false; $db->cacheSources = false;
$sources = $db->listSources(); $sources = $db->listSources();
$this->assertTrue(in_array($db->config['prefix'] . 'acos', $sources), 'acos should be present.'); $this->assertTrue(in_array($db->config['prefix'] . 'i18n', $sources), 'i18n 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.');
$schema = new DbAclSchema(); $schema = new I18nSchema();
$db->execute($db->dropSchema($schema, 'acos')); $db->execute($db->dropSchema($schema, 'i18n'));
} }
/** /**