Skip to content
Permalink
Browse files

Making plugin schema tests less likely to stomp on tables they should…

…n't be changing.
  • Loading branch information...
markstory committed Oct 23, 2010
1 parent b22da5a commit a72d6da9c3064175f6ac90c7e3c2b6ce1d540d9f
@@ -254,7 +254,7 @@ public function testDumpFileWritingWithPlugins() {
$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 @@ public function testPluginDotSyntaxWithCreate() {
$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'));
}
}
@@ -926,7 +926,7 @@ function testSchemaLoadingFromPlugin() {
));
$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();
}
@@ -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),

0 comments on commit a72d6da

Please sign in to comment.
You can’t perform that action at this time.