Making plugin schema tests less likely to stomp on tables they shouldn't be changing.

This commit is contained in:
mark_story 2010-10-23 00:54:39 -04:00
parent b22da5a3d1
commit a72d6da9c3
3 changed files with 5 additions and 9 deletions

View file

@ -254,7 +254,7 @@ class SchemaShellTest extends CakeTestCase {
$this->file =& new File(TMP . 'tests' . DS . 'dump_test.sql');
$contents = $this->file->read();
$this->assertPattern('/CREATE TABLE `acos`/', $contents);
$this->assertPattern('/CREATE TABLE `test_plugin_acos`/', $contents);
$this->assertPattern('/id/', $contents);
$this->assertPattern('/model/', $contents);
@ -478,11 +478,7 @@ class SchemaShellTest extends CakeTestCase {
$sources = $db->listSources();
$this->assertTrue(in_array($db->config['prefix'] . 'acos', $sources));
$schema = new CakeSchema(array(
'acos' => array(
'id' => array('type' => 'integer')
)
));
$db->execute($db->dropSchema($schema, 'acos'));
$schema = new TestPluginAppSchema();
$db->execute($db->dropSchema($schema, 'test_plugin_acos'));
}
}

View file

@ -926,7 +926,7 @@ class CakeSchemaTest extends CakeTestCase {
));
$Other =& $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));
$this->assertEqual($Other->name, 'TestPluginApp');
$this->assertEqual(array_keys($Other->tables), array('acos'));
$this->assertEqual(array_keys($Other->tables), array('test_plugin_acos'));
App::build();
}

View file

@ -23,7 +23,7 @@ class TestPluginAppSchema extends CakeSchema {
public $name = 'TestPluginApp';
public $acos = array(
public $test_plugin_acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),