Skip to content

Commit

Permalink
Update nested transaction test to use InnoDB table in MySQL.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Apr 25, 2012
1 parent f6288a4 commit 5f722cb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MysqlTest extends CakeTestCase {
public $fixtures = array(
'core.apple', 'core.article', 'core.articles_tag', 'core.attachment', 'core.comment',
'core.sample', 'core.tag', 'core.user', 'core.post', 'core.author', 'core.data_test',
'core.binary_test'
'core.binary_test', 'core.inno'
);

/**
Expand Down Expand Up @@ -3586,10 +3586,15 @@ public function testTruncateStatements() {
* @return void
*/
public function testNestedTransaction() {
$this->skipIf($this->Dbo->supportNestedTransaction() === false, 'The MySQL server do not support nested transaction');
$nested = $this->Dbo->nestedTransaction;
$this->Dbo->nestedTransaction = true;
if ($this->Dbo->supportNestedTransaction() === false) {
$this->Dbo->nestedTransaction = $nested;
$this->skipIf(true, 'The MySQL server do not support nested transaction');
}

$this->loadFixtures('Article');
$model = ClassRegistry::init('Article');
$this->loadFixtures('Inno');
$model = ClassRegistry::init('Inno');
$model->hasOne = $model->hasMany = $model->belongsTo = $model->hasAndBelongsToMany = array();
$model->cacheQueries = false;
$this->Dbo->cacheMethods = false;
Expand All @@ -3611,6 +3616,8 @@ public function testNestedTransaction() {

$this->assertTrue($this->Dbo->rollback());
$this->assertNotEmpty($model->read(null, 1));

$this->Dbo->nestedTransaction = $nested;
}

}

0 comments on commit 5f722cb

Please sign in to comment.