From 4e4637de2e5b4911058762e1dc58a6a01e149e10 Mon Sep 17 00:00:00 2001 From: Carnage Date: Sat, 10 Jan 2015 13:59:29 +0000 Subject: [PATCH] Added test to demonstrate issue --- .../Tests/ORM/Functional/Locking/OptimisticTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php b/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php index cd0e04b02..55e1b40b7 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php @@ -152,6 +152,19 @@ class OptimisticTest extends \Doctrine\Tests\OrmFunctionalTestCase } } + public function testLockWorksWithProxy() + { + $test = new OptimisticStandard(); + $test->name = 'test'; + $this->_em->persist($test); + $this->_em->flush(); + $this->_em->clear(); + + $proxy = $this->_em->getReference('Doctrine\Tests\ORM\Functional\Locking\OptimisticStandard', $test->id); + + $this->_em->lock($proxy, LockMode::OPTIMISTIC, 1); + } + public function testOptimisticTimestampSetsDefaultValue() { $test = new OptimisticTimestamp();