Skip to content

Commit

Permalink
Updating DboPostgres test to reflect changes in test suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 14, 2010
1 parent 8d58b40 commit 3ab6870
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
Expand Up @@ -157,7 +157,8 @@ class DboPostgresTest extends CakeTestCase {
* @access public
*/
var $fixtures = array('core.user', 'core.binary_test', 'core.comment', 'core.article',
'core.tag', 'core.articles_tag', 'core.attachment', 'core.person', 'core.post', 'core.author');
'core.tag', 'core.articles_tag', 'core.attachment', 'core.person', 'core.post', 'core.author',
);
/**
* Actual DB connection used in testing
*
Expand Down Expand Up @@ -477,16 +478,23 @@ function testCakeSchema() {
)');
$model =& ClassRegistry::init('datatypes');
$schema = new CakeSchema(array('connection' => 'test_suite'));
$result = $schema->read(array('connection' => 'test_suite'));
$schema->tables = $result['tables']['missing'];
$result = $schema->read(array(
'connection' => 'test_suite',
'models' => array('Datatype')
));
$schema->tables = array('datatypes' => $result['tables']['datatypes']);
$result = $db1->createSchema($schema, 'datatypes');
$this->assertNoPattern('/timestamp DEFAULT/', $result);
$this->assertPattern('/timestamp\s*,/', $result);

$db1->query('DROP TABLE ' . $db1->fullTableName('datatypes'));

$db1->query($result);
$result2 = $schema->read(array('connection' => 'test_suite'));
$schema->tables = $result2['tables']['missing'];
$result2 = $schema->read(array(
'connection' => 'test_suite',
'models' => array('Datatype')
));
$schema->tables = array('datatypes' => $result2['tables']['datatypes']);
$result2 = $db1->createSchema($schema, 'datatypes');
$this->assertEqual($result, $result2);

Expand Down

0 comments on commit 3ab6870

Please sign in to comment.