作者:selimc
项目:servigase
protected function setUp()
{
parent::enableSecondLevelCache();
parent::setUp();
$this->em = $this->_getTestEntityManager();
$this->cache = new DefaultCache($this->em);
}
作者:dracon
项目:forked-php-orm-benchmar
protected function setUp()
{
parent::setUp();
// SUT
$this->_connectionMock = new ConnectionMock(array(), new \Doctrine\Tests\Mocks\DriverMock());
$this->_emMock = EntityManagerMock::create($this->_connectionMock);
}
作者:Herriniain
项目:iVarotr
protected function setUp()
{
parent::setUp();
$em = $this->_getTestEntityManager();
$this->platform = $em->getConnection()->getDatabasePlatform();
$this->strategy = new DefaultQuoteStrategy();
}
作者:selimc
项目:servigase
protected function setUp()
{
$this->enableSecondLevelCache();
parent::setUp();
$this->em = $this->_getTestEntityManager();
$this->regionsConfig = new RegionsConfiguration();
$arguments = array($this->regionsConfig, $this->getSharedSecondLevelCacheDriverImpl());
$this->factory = $this->getMock('\\Doctrine\\ORM\\Cache\\DefaultCacheFactory', array('getRegion'), $arguments);
}
作者:pnaq5
项目:zf2dem
/**
* {@inheritDoc}
*/
protected function setUp()
{
parent::setUp();
$this->connectionMock = new ConnectionMock(array(), new DriverMock());
$this->emMock = EntityManagerMock::create($this->connectionMock);
$this->uowMock = new UnitOfWorkMock($this->emMock);
$this->emMock->setUnitOfWork($this->uowMock);
$this->proxyFactory = new ProxyFactory($this->emMock, sys_get_temp_dir(), 'Proxies', true);
}
作者:selimc
项目:servigase
protected function setUp()
{
parent::setUp();
$this->_connectionMock = new ConnectionMock(array(), new DriverMock());
$this->_emMock = EntityManagerMock::create($this->_connectionMock);
// SUT
$this->_unitOfWork = new UnitOfWorkMock($this->_emMock);
$this->_emMock->setUnitOfWork($this->_unitOfWork);
}
作者:selimc
项目:servigase
protected function setUp()
{
$this->getSharedSecondLevelCacheDriverImpl()->flushAll();
$this->enableSecondLevelCache();
parent::setUp();
$this->em = $this->_getTestEntityManager();
$this->region = $this->createRegion();
$this->entityPersister = $this->getMock('Doctrine\\ORM\\Persisters\\Entity\\EntityPersister', $this->entityPersisterMockMethods);
}
作者:selimc
项目:servigase
/**
* {@inheritDoc}
*/
protected function setUp()
{
parent::setUp();
$this->_em = $this->_getTestEntityManager();
$this->_em->getClassMetadata('Doctrine\\Tests\\Models\\GeoNames\\Country');
$this->_em->getClassMetadata('Doctrine\\Tests\\Models\\GeoNames\\Admin1');
$this->_em->getClassMetadata('Doctrine\\Tests\\Models\\GeoNames\\Admin1AlternateName');
$this->_persister = new BasicEntityPersister($this->_em, $this->_em->getClassMetadata('Doctrine\\Tests\\Models\\GeoNames\\Admin1AlternateName'));
}
作者:jsugg
项目:BBM_ol
public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed)
{
try {
$query = $this->_em->createQuery($dqlToBeTested);
parent::assertEquals($sqlToBeConfirmed, $query->getSql());
$query->free();
} catch (\Exception $e) {
$this->fail($e->getMessage());
}
}
作者:andrei
项目:doctrin
protected function setUp()
{
parent::setUp();
$this->_connectionMock = new ConnectionMock(array(), new \Doctrine\Tests\Mocks\DriverMock());
$this->_emMock = EntityManagerMock::create($this->_connectionMock);
$this->_uowMock = new UnitOfWorkMock($this->_emMock);
$this->_emMock->setUnitOfWork($this->_uowMock);
// SUT
$this->_proxyFactory = new ProxyFactory($this->_emMock, __DIR__ . '/generated', 'Proxies', true);
}
作者:jackbrav
项目:doctrin
protected function setUp()
{
parent::setUp();
$this->_connMock = new ConnectionMock(array(), new \Doctrine\Tests\Mocks\DriverMock());
$this->_emMock = EntityManagerMock::create($this->_connMock);
$this->_uowMock = new UnitOfWorkMock($this->_emMock);
$this->_emMock->setUnitOfWork($this->_uowMock);
$this->_idGenMock = new SequenceMock($this->_emMock, 'seq', 20);
//$this->_emMock->setIdGenerator('Doctrine\Tests\Models\Forum\ForumUser', $this->_idGenMock);
}
作者:selimc
项目:servigase
protected function setUp()
{
parent::setUp();
$this->enableSecondLevelCache();
$this->em = $this->_getTestEntityManager();
$this->region = new CacheRegionMock();
$this->queryCache = new DefaultQueryCache($this->em, $this->region);
$this->cacheFactory = new CacheFactoryDefaultQueryCacheTest($this->queryCache, $this->region);
$this->em->getConfiguration()->getSecondLevelCacheConfiguration()->setCacheFactory($this->cacheFactory);
}
作者:skoo
项目:doctrine
public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed)
{
try {
$query = $this->_em->createQuery($dqlToBeTested);
$query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true)->useQueryCache(false);
parent::assertEquals($sqlToBeConfirmed, $query->getSql());
$query->free();
} catch (\Exception $e) {
$this->fail($e->getMessage());
}
}
作者:jackbrav
项目:doctrin
public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed)
{
try {
$query = $this->_em->createQuery($dqlToBeTested);
parent::assertEquals($sqlToBeConfirmed, $query->getSql());
$query->free();
} catch (Doctrine_Exception $e) {
echo $e->getMessage();
echo $e->getTraceAsString();
die;
$this->fail($e->getMessage());
}
}
作者:bardasca
项目:blogif
protected function setUp()
{
parent::setUp();
if (DBALType::hasType('negative_to_positive')) {
DBALType::overrideType('negative_to_positive', '\\Doctrine\\Tests\\DbalTypes\\NegativeToPositiveType');
} else {
DBALType::addType('negative_to_positive', '\\Doctrine\\Tests\\DbalTypes\\NegativeToPositiveType');
}
if (DBALType::hasType('upper_case_string')) {
DBALType::overrideType('upper_case_string', '\\Doctrine\\Tests\\DbalTypes\\UpperCaseStringType');
} else {
DBALType::addType('upper_case_string', '\\Doctrine\\Tests\\DbalTypes\\UpperCaseStringType');
}
$this->_em = $this->_getTestEntityManager();
$this->_persister = new BasicEntityPersister($this->_em, $this->_em->getClassMetadata("Doctrine\\Tests\\Models\\CustomType\\CustomTypeParent"));
}
作者:dracon
项目:forked-php-orm-benchmar
/**
* Assert a valid SQL generation.
*
* @param string $dqlToBeTested
* @param string $sqlToBeConfirmed
* @param array $queryHints
* @param array $queryParams
*/
public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed, array $queryHints = array(), array $queryParams = array())
{
try {
$query = $this->_em->createQuery($dqlToBeTested);
foreach ($queryParams as $name => $value) {
$query->setParameter($name, $value);
}
$query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true)->useQueryCache(false);
foreach ($queryHints as $name => $value) {
$query->setHint($name, $value);
}
parent::assertEquals($sqlToBeConfirmed, $query->getSql());
$query->free();
} catch (\Exception $e) {
$this->fail($e->getMessage() . "\n" . $e->getTraceAsString());
}
}
作者:selimc
项目:servigase
protected function setUp()
{
parent::setUp();
$this->resolver = new DefaultEntityListenerResolver();
}
作者:selimc
项目:servigase
protected function setUp()
{
parent::setUp();
$this->_emMock = EntityManagerMock::create(new ConnectionMock([], new DriverMock()));
}
作者:jsugg
项目:BBM_ol
function setUp()
{
parent::setUp();
$this->_em = $this->_getTestEntityManager();
}
作者:selimc
项目:servigase
/**
* {@inheritDoc}
*/
protected function setUp()
{
parent::setUp();
$this->em = $this->_getTestEntityManager();
$this->persister = new JoinedSubclassPersister($this->em, $this->em->getClassMetadata('Doctrine\\Tests\\Models\\JoinedInheritanceType\\RootClass'));
}