This commit is contained in:
parent
f8893f27c2
commit
514d67ef05
@ -135,7 +135,7 @@ class Doctrine_Connection_TestCase extends Doctrine_UnitTestCase {
|
|||||||
}
|
}
|
||||||
public function testDelete() {
|
public function testDelete() {
|
||||||
$user = $this->connection->create('User');
|
$user = $this->connection->create('User');
|
||||||
$this->connection->delete($user);
|
$this->connection->unitOfWork->delete($user);
|
||||||
$this->assertEqual($user->state(),Doctrine_Record::STATE_TCLEAN);
|
$this->assertEqual($user->state(),Doctrine_Record::STATE_TCLEAN);
|
||||||
}
|
}
|
||||||
public function testGetTable() {
|
public function testGetTable() {
|
||||||
@ -185,15 +185,15 @@ class Doctrine_Connection_TestCase extends Doctrine_UnitTestCase {
|
|||||||
$this->assertEqual($this->connection->transaction->getTransactionLevel(),0);
|
$this->assertEqual($this->connection->transaction->getTransactionLevel(),0);
|
||||||
$this->connection->beginTransaction();
|
$this->connection->beginTransaction();
|
||||||
$this->assertEqual($this->connection->transaction->getTransactionLevel(),1);
|
$this->assertEqual($this->connection->transaction->getTransactionLevel(),1);
|
||||||
$this->assertEqual($this->connection->transaction->getState(),Doctrine_Transaction::STATE_ACTIVE);
|
$this->assertEqual($this->connection->transaction->getState(), Doctrine_Transaction::STATE_ACTIVE);
|
||||||
$this->connection->beginTransaction();
|
$this->connection->beginTransaction();
|
||||||
$this->assertEqual($this->connection->transaction->getState(),Doctrine_Transaction::STATE_BUSY);
|
$this->assertEqual($this->connection->transaction->getState(), Doctrine_Transaction::STATE_BUSY);
|
||||||
$this->assertEqual($this->connection->transaction->getTransactionLevel(),2);
|
$this->assertEqual($this->connection->transaction->getTransactionLevel(),2);
|
||||||
$this->connection->commit();
|
$this->connection->commit();
|
||||||
$this->assertEqual($this->connection->transaction->getState(),Doctrine_Transaction::STATE_ACTIVE);
|
$this->assertEqual($this->connection->transaction->getState(), Doctrine_Transaction::STATE_ACTIVE);
|
||||||
$this->assertEqual($this->connection->transaction->getTransactionLevel(),1);
|
$this->assertEqual($this->connection->transaction->getTransactionLevel(),1);
|
||||||
$this->connection->commit();
|
$this->connection->commit();
|
||||||
$this->assertEqual($this->connection->transaction->getState(),Doctrine_Transaction::STATE_SLEEP);
|
$this->assertEqual($this->connection->transaction->getState(), Doctrine_Transaction::STATE_SLEEP);
|
||||||
$this->assertEqual($this->connection->transaction->getTransactionLevel(),0);
|
$this->assertEqual($this->connection->transaction->getTransactionLevel(),0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,7 @@ class Doctrine_PessimisticLocking_TestCase extends Doctrine_UnitTestCase {
|
|||||||
*
|
*
|
||||||
* Creates a locking manager and a test record to work with.
|
* Creates a locking manager and a test record to work with.
|
||||||
*/
|
*/
|
||||||
public function setUp() {
|
public function testInitData() {
|
||||||
parent::setUp();
|
|
||||||
$this->lockingManager = new Doctrine_Locking_Manager_Pessimistic($this->connection);
|
$this->lockingManager = new Doctrine_Locking_Manager_Pessimistic($this->connection);
|
||||||
|
|
||||||
// Create sample data to test on
|
// Create sample data to test on
|
||||||
@ -97,7 +96,7 @@ class Doctrine_PessimisticLocking_TestCase extends Doctrine_UnitTestCase {
|
|||||||
$released = $this->lockingManager->releaseAgedLocks(-1, 'Forum_Entry', 'romanb'); // should release the lock
|
$released = $this->lockingManager->releaseAgedLocks(-1, 'Forum_Entry', 'romanb'); // should release the lock
|
||||||
$this->assertEqual(1, $released);
|
$this->assertEqual(1, $released);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the retrieving of a lock's owner.
|
* Tests the retrieving of a lock's owner.
|
||||||
* This test implicitly tests getLock().
|
* This test implicitly tests getLock().
|
||||||
|
Loading…
x
Reference in New Issue
Block a user