2010-12-15 01:26:40 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
|
|
|
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
use Doctrine\Tests\Models\CMS\CmsUser;
|
|
|
|
use Doctrine\Tests\Models\CMS\CmsGroup;
|
|
|
|
|
|
|
|
require_once __DIR__ . '/../../../TestInit.php';
|
|
|
|
|
|
|
|
class DDC933Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|
|
|
{
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$this->useModelSet('company');
|
|
|
|
parent::setUp();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @group DDC-933
|
|
|
|
*/
|
|
|
|
public function testLockCTIClass()
|
|
|
|
{
|
2010-12-22 00:33:23 +03:00
|
|
|
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger());
|
|
|
|
|
2010-12-15 01:26:40 +03:00
|
|
|
$manager = new \Doctrine\Tests\Models\Company\CompanyManager();
|
|
|
|
$manager->setName('beberlei');
|
|
|
|
$manager->setSalary(1234);
|
2013-03-11 04:08:58 +04:00
|
|
|
$manager->setTitle('Vice President of This Test');
|
2010-12-15 01:26:40 +03:00
|
|
|
$manager->setDepartment("Foo");
|
|
|
|
|
|
|
|
$this->_em->persist($manager);
|
|
|
|
$this->_em->flush();
|
|
|
|
|
|
|
|
$this->_em->beginTransaction();
|
|
|
|
$this->_em->lock($manager, \Doctrine\DBAL\LockMode::PESSIMISTIC_READ);
|
|
|
|
$this->_em->rollback();
|
|
|
|
}
|
|
|
|
}
|