1
0
mirror of synced 2025-01-18 14:31:40 +03:00

Fixed incorrect transaction management in locking tests.

This commit is contained in:
Roman S. Borschel 2010-06-07 00:14:43 +02:00
parent 35e49aaf9f
commit 4a9369de9e
3 changed files with 15 additions and 7 deletions

View File

@ -125,7 +125,13 @@ class LockTest extends \Doctrine\Tests\OrmFunctionalTestCase {
$this->_em->flush();
$this->_em->beginTransaction();
$this->_em->lock($article, LockMode::PESSIMISTIC_WRITE);
try {
$this->_em->lock($article, LockMode::PESSIMISTIC_WRITE);
$this->_em->commit();
} catch (\Exception $e) {
$this->_em->rollback();
throw $e;
}
$query = array_pop( $this->_sqlLoggerStack->queries );
$this->assertContains($writeLockSql, $query['sql']);
@ -149,7 +155,13 @@ class LockTest extends \Doctrine\Tests\OrmFunctionalTestCase {
$this->_em->flush();
$this->_em->beginTransaction();
$this->_em->lock($article, LockMode::PESSIMISTIC_READ);
try {
$this->_em->lock($article, LockMode::PESSIMISTIC_READ);
$this->_em->commit();
} catch (\Exception $e) {
$this->_em->rollback();
throw $e;
}
$query = array_pop( $this->_sqlLoggerStack->queries );
$this->assertContains($readLockSql, $query['sql']);

View File

@ -8,7 +8,6 @@ class DDC144Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
protected function setUp() {
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(array(

View File

@ -10,15 +10,12 @@ class DDC353Test extends \Doctrine\Tests\OrmFunctionalTestCase
protected function setUp()
{
parent::setUp();
try {
$this->_schemaTool->createSchema(array(
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC353File'),
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC353Picture'),
));
} catch(\Exception $e) {
}
} catch(\Exception $ignored) {}
}
public function testWorkingCase()