Skip to content

Commit

Permalink
Making plugin schema tests less likely to stomp on tables they should…
Browse files Browse the repository at this point in the history
…n't be changing.
  • Loading branch information
markstory committed Oct 23, 2010
1 parent b22da5a commit a72d6da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions cake/tests/cases/console/shells/schema.test.php
Expand Up @@ -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);

Expand Down Expand Up @@ -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'));
}
}
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/model/cake_schema.test.php
Expand Up @@ -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();
}
Expand Down
Expand Up @@ -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),
Expand Down

0 comments on commit a72d6da

Please sign in to comment.