Renamed variable name from nested transaction

This commit is contained in:
Juan Basso 2012-04-26 20:53:18 -04:00
parent 37537faac0
commit 333ea29805
8 changed files with 18 additions and 18 deletions

View file

@ -682,7 +682,7 @@ class Mysql extends DboSource {
* @return boolean * @return boolean
*/ */
public function nestedTransactionSupported() { public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '4.1', '>='); return $this->useNestedTransactions && version_compare($this->getVersion(), '4.1', '>=');
} }
} }

View file

@ -901,7 +901,7 @@ class Postgres extends DboSource {
* @return boolean * @return boolean
*/ */
public function nestedTransactionSupported() { public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '8.0', '>='); return $this->useNestedTransactions && version_compare($this->getVersion(), '8.0', '>=');
} }
} }

View file

@ -565,7 +565,7 @@ class Sqlite extends DboSource {
* @return boolean * @return boolean
*/ */
public function nestedTransactionSupported() { public function nestedTransactionSupported() {
return $this->nestedTransaction && version_compare($this->getVersion(), '3.6.8', '>='); return $this->useNestedTransactions && version_compare($this->getVersion(), '3.6.8', '>=');
} }
} }

View file

@ -76,7 +76,7 @@ class DboSource extends DataSource {
* *
* @var boolean * @var boolean
*/ */
public $nestedTransaction = false; public $useNestedTransactions = false;
/** /**
* Print full query debug info? * Print full query debug info?

View file

@ -3586,10 +3586,10 @@ class MysqlTest extends CakeTestCase {
* @return void * @return void
*/ */
public function testNestedTransaction() { public function testNestedTransaction() {
$nested = $this->Dbo->nestedTransaction; $nested = $this->Dbo->useNestedTransactions;
$this->Dbo->nestedTransaction = true; $this->Dbo->useNestedTransactions = true;
if ($this->Dbo->nestedTransactionSupported() === false) { if ($this->Dbo->nestedTransactionSupported() === false) {
$this->Dbo->nestedTransaction = $nested; $this->Dbo->useNestedTransactions = $nested;
$this->skipIf(true, 'The MySQL server do not support nested transaction'); $this->skipIf(true, 'The MySQL server do not support nested transaction');
} }
@ -3617,7 +3617,7 @@ class MysqlTest extends CakeTestCase {
$this->assertTrue($this->Dbo->rollback()); $this->assertTrue($this->Dbo->rollback());
$this->assertNotEmpty($model->read(null, 1)); $this->assertNotEmpty($model->read(null, 1));
$this->Dbo->nestedTransaction = $nested; $this->Dbo->useNestedTransactions = $nested;
} }
} }

View file

@ -54,7 +54,7 @@ class DboTestSource extends DboSource {
} }
public function nestedTransactionSupported() { public function nestedTransactionSupported() {
return $this->nestedTransaction && $this->nestedSupport; return $this->useNestedTransactions && $this->nestedSupport;
} }
} }
@ -849,7 +849,7 @@ class DboSourceTest extends CakeTestCase {
$conn = $this->getMock('MockPDO'); $conn = $this->getMock('MockPDO');
$db = new DboTestSource(); $db = new DboTestSource();
$db->setConnection($conn); $db->setConnection($conn);
$db->nestedTransaction = true; $db->useNestedTransactions = true;
$db->nestedSupport = true; $db->nestedSupport = true;
$conn->expects($this->at(0))->method('beginTransaction')->will($this->returnValue(true)); $conn->expects($this->at(0))->method('beginTransaction')->will($this->returnValue(true));
@ -871,7 +871,7 @@ class DboSourceTest extends CakeTestCase {
$conn = $this->getMock('MockPDO'); $conn = $this->getMock('MockPDO');
$db = new DboTestSource(); $db = new DboTestSource();
$db->setConnection($conn); $db->setConnection($conn);
$db->nestedTransaction = true; $db->useNestedTransactions = true;
$db->nestedSupport = false; $db->nestedSupport = false;
$conn->expects($this->once())->method('beginTransaction')->will($this->returnValue(true)); $conn->expects($this->once())->method('beginTransaction')->will($this->returnValue(true));
@ -890,7 +890,7 @@ class DboSourceTest extends CakeTestCase {
$conn = $this->getMock('MockPDO'); $conn = $this->getMock('MockPDO');
$db = new DboTestSource(); $db = new DboTestSource();
$db->setConnection($conn); $db->setConnection($conn);
$db->nestedTransaction = false; $db->useNestedTransactions = false;
$db->nestedSupport = true; $db->nestedSupport = true;
$conn->expects($this->once())->method('beginTransaction')->will($this->returnValue(true)); $conn->expects($this->once())->method('beginTransaction')->will($this->returnValue(true));

View file

@ -193,8 +193,8 @@ class CakeFixtureManager {
return; return;
} }
$nested = $test->db->nestedTransaction; $nested = $test->db->useNestedTransactions;
$test->db->nestedTransaction = false; $test->db->useNestedTransactions = false;
$test->db->begin(); $test->db->begin();
foreach ($fixtures as $f) { foreach ($fixtures as $f) {
if (!empty($this->_loaded[$f])) { if (!empty($this->_loaded[$f])) {
@ -205,7 +205,7 @@ class CakeFixtureManager {
} }
} }
$test->db->commit(); $test->db->commit();
$test->db->nestedTransaction = $nested; $test->db->useNestedTransactions = $nested;
} }
/** /**

View file

@ -241,10 +241,10 @@ class CakeTestFixture {
$fields = array_keys($record); $fields = array_keys($record);
$values[] = array_values(array_merge($default, $record)); $values[] = array_values(array_merge($default, $record));
} }
$nested = $db->nestedTransaction; $nested = $db->useNestedTransactions;
$db->nestedTransaction = false; $db->useNestedTransactions = false;
$result = $db->insertMulti($this->table, $fields, $values); $result = $db->insertMulti($this->table, $fields, $values);
$db->nestedTransaction = $nested; $db->useNestedTransactions = $nested;
return $result; return $result;
} }
return true; return true;