mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
parent
fbb1a812dd
commit
f104bd3504
1 changed files with 11 additions and 6 deletions
|
@ -746,12 +746,16 @@ class PostgresTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testAlterSchemaRenameTo() {
|
public function testAlterSchemaRenameTo() {
|
||||||
$query = $this->Dbo->alterSchema(array(
|
$query = $this->Dbo->alterSchema(array(
|
||||||
'posts' => array('change' => array('title' => array('name' => 'subject', 'type' => 'string', 'null' => false)))
|
'posts' => array(
|
||||||
));
|
'change' => array(
|
||||||
$this->assertRegExp('/RENAME "title" TO "subject";/i', $query);
|
'title' => array('name' => 'subject', 'type' => 'string', 'null' => false)
|
||||||
$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);
|
));
|
||||||
|
$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 @@ class PostgresTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testNestedTransaction() {
|
public function testNestedTransaction() {
|
||||||
|
$this->Dbo->useNestedTransactions = true;
|
||||||
$this->skipIf($this->Dbo->nestedTransactionSupported() === false, 'The Postgres server do not support nested transaction');
|
$this->skipIf($this->Dbo->nestedTransactionSupported() === false, 'The Postgres server do not support nested transaction');
|
||||||
|
|
||||||
$this->loadFixtures('Article');
|
$this->loadFixtures('Article');
|
||||||
|
|
Loading…
Reference in a new issue