当前位置: 首页>>代码示例>>PHP>>正文


PHP Tests\OrmTestCase类代码示例

本文整理汇总了PHP中Doctrine\Tests\OrmTestCase的典型用法代码示例。如果您正苦于以下问题:PHP OrmTestCase类的具体用法?PHP OrmTestCase怎么用?PHP OrmTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OrmTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 protected function setUp()
 {
     parent::enableSecondLevelCache();
     parent::setUp();
     $this->em = $this->_getTestEntityManager();
     $this->cache = new DefaultCache($this->em);
 }
开发者ID:selimcr,项目名称:servigases,代码行数:7,代码来源:DefaultCacheTest.php

示例2: setUp

 protected function setUp()
 {
     parent::setUp();
     // SUT
     $this->_connectionMock = new ConnectionMock(array(), new \Doctrine\Tests\Mocks\DriverMock());
     $this->_emMock = EntityManagerMock::create($this->_connectionMock);
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:7,代码来源:PersistentCollectionTest.php

示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     $em = $this->_getTestEntityManager();
     $this->platform = $em->getConnection()->getDatabasePlatform();
     $this->strategy = new DefaultQuoteStrategy();
 }
开发者ID:Herriniaina,项目名称:iVarotra,代码行数:7,代码来源:QuoteStrategyTest.php

示例4: setUp

 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);
 }
开发者ID:selimcr,项目名称:servigases,代码行数:9,代码来源:DefaultCacheFactoryTest.php

示例5: setUp

 /**
  * {@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);
 }
开发者ID:pnaq57,项目名称:zf2demo,代码行数:12,代码来源:ProxyFactoryTest.php

示例6: setUp

 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);
 }
开发者ID:selimcr,项目名称:servigases,代码行数:9,代码来源:UnitOfWorkTest.php

示例7: setUp

 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);
 }
开发者ID:selimcr,项目名称:servigases,代码行数:9,代码来源:AbstractEntityPersisterTest.php

示例8: setUp

 /**
  * {@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'));
 }
开发者ID:selimcr,项目名称:servigases,代码行数:12,代码来源:BasicEntityPersisterCompositeTypeParametersTest.php

示例9: assertSqlGeneration

 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());
     }
 }
开发者ID:jsuggs,项目名称:BBM_old,代码行数:10,代码来源:UpdateSqlGenerationTest.php

示例10: setUp

 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);
 }
开发者ID:andreia,项目名称:doctrine,代码行数:10,代码来源:ProxyClassGeneratorTest.php

示例11: setUp

 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);
 }
开发者ID:jackbravo,项目名称:doctrine,代码行数:10,代码来源:EntityPersisterTest.php

示例12: setUp

 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);
 }
开发者ID:selimcr,项目名称:servigases,代码行数:10,代码来源:DefaultQueryCacheTest.php

示例13: assertSqlGeneration

 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());
     }
 }
开发者ID:skoop,项目名称:doctrine2,代码行数:11,代码来源:SelectSqlGenerationTest.php

示例14: assertSqlGeneration

 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());
     }
 }
开发者ID:jackbravo,项目名称:doctrine,代码行数:13,代码来源:SelectSqlGenerationTest.php

示例15: setUp

 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"));
 }
开发者ID:bardascat,项目名称:blogify,代码行数:16,代码来源:BasicEntityPersisterTypeValueSqlTest.php


注:本文中的Doctrine\Tests\OrmTestCase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。