Skip to content
Browse files

Update nested transaction test to use InnoDB table in MySQL.

  • Loading branch information...
1 parent f6288a4 commit 5f722cb3d4deb68dbda9941213c9ae11390d0759 @jrbasso jrbasso committed Apr 24, 2012
Showing with 11 additions and 4 deletions.
  1. +11 −4 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
View
15 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
@@ -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'
);
/**
@@ -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;
@@ -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.
Something went wrong with that request. Please try again.