Commit 6daa1e34 authored by zYne's avatar zYne

fixed references to deprecated getTransaction() and getUnitOfWork() methods

parent 4f361df6
...@@ -76,12 +76,12 @@ abstract class Doctrine_Configurable { ...@@ -76,12 +76,12 @@ abstract class Doctrine_Configurable {
break; break;
case Doctrine::ATTR_LOCKMODE: case Doctrine::ATTR_LOCKMODE:
if($this instanceof Doctrine_Connection) { if($this instanceof Doctrine_Connection) {
if($this->getTransaction()->getState() != Doctrine_Connection_Transaction::STATE_OPEN) if($this->transaction->getState() != Doctrine_Connection_Transaction::STATE_OPEN)
throw new Doctrine_Exception("Couldn't set lockmode. There are transactions open."); throw new Doctrine_Exception("Couldn't set lockmode. There are transactions open.");
} elseif($this instanceof Doctrine_Manager) { } elseif($this instanceof Doctrine_Manager) {
foreach($this as $connection) { foreach($this as $connection) {
if($connection->getTransaction()->getState() != Doctrine_Connection_Transaction::STATE_OPEN) if($connection->transaction->getState() != Doctrine_Connection_Transaction::STATE_OPEN)
throw new Doctrine_Exception("Couldn't set lockmode. There are transactions open."); throw new Doctrine_Exception("Couldn't set lockmode. There are transactions open.");
} }
} else { } else {
......
...@@ -864,12 +864,12 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite ...@@ -864,12 +864,12 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$conn->beginTransaction(); $conn->beginTransaction();
$saveLater = $conn->getUnitOfWork()->saveRelated($this); $saveLater = $conn->unitOfWork->saveRelated($this);
if ($this->isValid()) { if ($this->isValid()) {
$conn->save($this); $conn->save($this);
} else { } else {
$conn->getTransaction()->addInvalid($this); $conn->transaction->addInvalid($this);
} }
foreach($saveLater as $fk) { foreach($saveLater as $fk) {
...@@ -884,7 +884,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite ...@@ -884,7 +884,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
// save the MANY-TO-MANY associations // save the MANY-TO-MANY associations
$conn->getUnitOfWork()->saveAssociations($this); $conn->unitOfWork->saveAssociations($this);
//$this->saveAssociations(); //$this->saveAssociations();
$conn->commit(); $conn->commit();
......
This diff is collapsed.
...@@ -30,6 +30,7 @@ class Doctrine_UnitTestCase extends UnitTestCase { ...@@ -30,6 +30,7 @@ class Doctrine_UnitTestCase extends UnitTestCase {
protected $users; protected $users;
protected $valueHolder; protected $valueHolder;
protected $tables = array(); protected $tables = array();
protected $unitOfWork;
private $init = false; private $init = false;
...@@ -79,7 +80,7 @@ class Doctrine_UnitTestCase extends UnitTestCase { ...@@ -79,7 +80,7 @@ class Doctrine_UnitTestCase extends UnitTestCase {
$this->listener = new Doctrine_EventListener_Debugger(); $this->listener = new Doctrine_EventListener_Debugger();
$this->manager->setAttribute(Doctrine::ATTR_LISTENER, $this->listener); $this->manager->setAttribute(Doctrine::ATTR_LISTENER, $this->listener);
} }
$this->unitOfWork = $this->connection->unitOfWork;
$this->connection->setListener(new Doctrine_EventListener()); $this->connection->setListener(new Doctrine_EventListener());
$this->query = new Doctrine_Query($this->connection); $this->query = new Doctrine_Query($this->connection);
$this->prepareTables(); $this->prepareTables();
......
...@@ -43,6 +43,8 @@ require_once('QueryShortAliasesTestCase.php'); ...@@ -43,6 +43,8 @@ require_once('QueryShortAliasesTestCase.php');
require_once('QueryDeleteTestCase.php'); require_once('QueryDeleteTestCase.php');
require_once('QueryUpdateTestCase.php'); require_once('QueryUpdateTestCase.php');
require_once('UnitOfWorkTestCase.php');
require_once('RelationAccessTestCase.php'); require_once('RelationAccessTestCase.php');
require_once('RelationTestCase.php'); require_once('RelationTestCase.php');
require_once('RelationManyToManyTestCase.php'); require_once('RelationManyToManyTestCase.php');
...@@ -67,6 +69,10 @@ print '<pre>'; ...@@ -67,6 +69,10 @@ print '<pre>';
$test = new GroupTest('Doctrine Framework Unit Tests'); $test = new GroupTest('Doctrine Framework Unit Tests');
$test->addTestCase(new Doctrine_UnitOfWork_TestCase());
$test->addTestCase(new Doctrine_ConnectionTestCase());
$test->addTestCase(new Doctrine_Db_TestCase()); $test->addTestCase(new Doctrine_Db_TestCase());
$test->addTestCase(new Doctrine_Db_Profiler_TestCase()); $test->addTestCase(new Doctrine_Db_Profiler_TestCase());
...@@ -75,8 +81,6 @@ $test->addTestCase(new Doctrine_Query_MultiJoin_TestCase()); ...@@ -75,8 +81,6 @@ $test->addTestCase(new Doctrine_Query_MultiJoin_TestCase());
$test->addTestCase(new Doctrine_Record_TestCase()); $test->addTestCase(new Doctrine_Record_TestCase());
$test->addTestCase(new Doctrine_ConnectionTestCase());
$test->addTestCase(new Doctrine_DataDict_Pgsql_TestCase()); $test->addTestCase(new Doctrine_DataDict_Pgsql_TestCase());
$test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase()); $test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment