mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Making plugin schema tests less likely to stomp on tables they shouldn't be changing.
This commit is contained in:
parent
b22da5a3d1
commit
a72d6da9c3
3 changed files with 5 additions and 9 deletions
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue