Skip to content
Permalink
Browse files

Use simpler asserts.

Refs #3622
  • Loading branch information...
markstory committed Feb 14, 2013
1 parent fbb1a81 commit f104bd3504d5907fbfc1e833e768694456700f6e
Showing with 11 additions and 6 deletions.
  1. +11 −6 lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php
@@ -746,12 +746,16 @@ public function testAlterIndexes() {
*/
public function testAlterSchemaRenameTo() {
$query = $this->Dbo->alterSchema(array(
'posts' => array('change' => array('title' => array('name' => 'subject', 'type' => 'string', 'null' => false)))
));
$this->assertRegExp('/RENAME "title" TO "subject";/i', $query);
$this->assertRegExp('/ALTER COLUMN "subject" TYPE /i', $query);
$this->assertNotRegExp('/;\n\tALTER COLUMN "subject" TYPE /i', $query);
$this->assertNotRegExp('/ALTER COLUMN "title" TYPE "subject"/i', $query);
'posts' => array(
'change' => array(
'title' => array('name' => 'subject', 'type' => 'string', 'null' => false)
)
)
));
$this->assertContains('RENAME "title" TO "subject";', $query);
$this->assertContains('ALTER COLUMN "subject" TYPE', $query);
$this->assertNotContains(";\n\tALTER COLUMN \"subject\" TYPE", $query);
$this->assertNotContains('ALTER COLUMN "title" TYPE "subject"', $query);
}
/**
@@ -937,6 +941,7 @@ public function testTruncateStatements() {
* @return void
*/
public function testNestedTransaction() {
$this->Dbo->useNestedTransactions = true;
$this->skipIf($this->Dbo->nestedTransactionSupported() === false, 'The Postgres server do not support nested transaction');
$this->loadFixtures('Article');

0 comments on commit f104bd3

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