Skip to content

Commit

Permalink
Renamed variable name from nested transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Apr 27, 2012
1 parent 37537fa commit 333ea29
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Mysql.php
Expand Up @@ -682,7 +682,7 @@ public function getSchemaName() {
* @return boolean
*/
public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '4.1', '>=');
return $this->useNestedTransactions && version_compare($this->getVersion(), '4.1', '>=');
}

}
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Postgres.php
Expand Up @@ -901,7 +901,7 @@ public function getSchemaName() {
* @return boolean
*/
public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '8.0', '>=');
return $this->useNestedTransactions && version_compare($this->getVersion(), '8.0', '>=');
}

}
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Sqlite.php
Expand Up @@ -565,7 +565,7 @@ public function getSchemaName() {
* @return boolean
*/
public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '3.6.8', '>=');
return $this->useNestedTransactions && version_compare($this->getVersion(), '3.6.8', '>=');
}

}
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -76,7 +76,7 @@ class DboSource extends DataSource {
*
* @var boolean
*/
public $nestedTransaction = false;
public $useNestedTransactions = false;

/**
* Print full query debug info?
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
Expand Up @@ -3586,10 +3586,10 @@ public function testTruncateStatements() {
* @return void
*/
public function testNestedTransaction() {
$nested = $this->Dbo->nestedTransaction;
$this->Dbo->nestedTransaction = true;
$nested = $this->Dbo->useNestedTransactions;
$this->Dbo->useNestedTransactions = true;
if ($this->Dbo->nestedTransactionSupported() === false) {
$this->Dbo->nestedTransaction = $nested;
$this->Dbo->useNestedTransactions = $nested;
$this->skipIf(true, 'The MySQL server do not support nested transaction');
}

Expand Down Expand Up @@ -3617,7 +3617,7 @@ public function testNestedTransaction() {
$this->assertTrue($this->Dbo->rollback());
$this->assertNotEmpty($model->read(null, 1));

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

}
8 changes: 4 additions & 4 deletions lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php
Expand Up @@ -54,7 +54,7 @@ public function setConnection($conn) {
}

public function nestedTransactionSupported() {
return $this->nestedTransaction && $this->nestedSupport;
return $this->useNestedTransactions && $this->nestedSupport;
}

}
Expand Down Expand Up @@ -849,7 +849,7 @@ public function testTransactionNested() {
$conn = $this->getMock('MockPDO');
$db = new DboTestSource();
$db->setConnection($conn);
$db->nestedTransaction = true;
$db->useNestedTransactions = true;
$db->nestedSupport = true;

$conn->expects($this->at(0))->method('beginTransaction')->will($this->returnValue(true));
Expand All @@ -871,7 +871,7 @@ public function testTransactionNestedWithoutSupport() {
$conn = $this->getMock('MockPDO');
$db = new DboTestSource();
$db->setConnection($conn);
$db->nestedTransaction = true;
$db->useNestedTransactions = true;
$db->nestedSupport = false;

$conn->expects($this->once())->method('beginTransaction')->will($this->returnValue(true));
Expand All @@ -890,7 +890,7 @@ public function testTransactionNestedDisabled() {
$conn = $this->getMock('MockPDO');
$db = new DboTestSource();
$db->setConnection($conn);
$db->nestedTransaction = false;
$db->useNestedTransactions = false;
$db->nestedSupport = true;

$conn->expects($this->once())->method('beginTransaction')->will($this->returnValue(true));
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
Expand Up @@ -193,8 +193,8 @@ public function load(CakeTestCase $test) {
return;
}

$nested = $test->db->nestedTransaction;
$test->db->nestedTransaction = false;
$nested = $test->db->useNestedTransactions;
$test->db->useNestedTransactions = false;
$test->db->begin();
foreach ($fixtures as $f) {
if (!empty($this->_loaded[$f])) {
Expand All @@ -205,7 +205,7 @@ public function load(CakeTestCase $test) {
}
}
$test->db->commit();
$test->db->nestedTransaction = $nested;
$test->db->useNestedTransactions = $nested;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/TestSuite/Fixture/CakeTestFixture.php
Expand Up @@ -241,10 +241,10 @@ public function insert($db) {
$fields = array_keys($record);
$values[] = array_values(array_merge($default, $record));
}
$nested = $db->nestedTransaction;
$db->nestedTransaction = false;
$nested = $db->useNestedTransactions;
$db->useNestedTransactions = false;
$result = $db->insertMulti($this->table, $fields, $values);
$db->nestedTransaction = $nested;
$db->useNestedTransactions = $nested;
return $result;
}
return true;
Expand Down

0 comments on commit 333ea29

Please sign in to comment.