DDC933Test.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Doctrine\Tests\ORM\Functional\Ticket;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Tests\Models\CMS\CmsUser;
  5. use Doctrine\Tests\Models\CMS\CmsGroup;
  6. require_once __DIR__ . '/../../../TestInit.php';
  7. class DDC933Test extends \Doctrine\Tests\OrmFunctionalTestCase
  8. {
  9. public function setUp()
  10. {
  11. $this->useModelSet('company');
  12. parent::setUp();
  13. }
  14. /**
  15. * @group DDC-933
  16. */
  17. public function testLockCTIClass()
  18. {
  19. //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger());
  20. $manager = new \Doctrine\Tests\Models\Company\CompanyManager();
  21. $manager->setName('beberlei');
  22. $manager->setSalary(1234);
  23. $manager->setTitle('Vice Precident of This Test');
  24. $manager->setDepartment("Foo");
  25. $this->_em->persist($manager);
  26. $this->_em->flush();
  27. $this->_em->beginTransaction();
  28. $this->_em->lock($manager, \Doctrine\DBAL\LockMode::PESSIMISTIC_READ);
  29. $this->_em->rollback();
  30. }
  31. }