當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OrmTestCase::setUp方法代碼示例

本文整理匯總了PHP中Doctrine\Tests\OrmTestCase::setUp方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrmTestCase::setUp方法的具體用法?PHP OrmTestCase::setUp怎麽用?PHP OrmTestCase::setUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\Tests\OrmTestCase的用法示例。


在下文中一共展示了OrmTestCase::setUp方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: setUp

 protected function setUp()
 {
     parent::enableSecondLevelCache();
     parent::setUp();
     $this->em = $this->_getTestEntityManager();
     $this->cache = new DefaultCache($this->em);
 }
開發者ID:selimcr,項目名稱:servigases,代碼行數:7,代碼來源:DefaultCacheTest.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

 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

示例6: 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

示例7: setUp

 /**
  * Bootstrap
  */
 public function setUp()
 {
     parent::setUp();
     $reader = new AnnotationReader();
     $metadataDriver = new AnnotationDriver($reader, User::class);
     $this->em = $this->_getTestEntityManager();
     $this->em->getConfiguration()->setMetadataDriverImpl($metadataDriver);
     $this->obj = $this->em->getRepository(User::class);
 }
開發者ID:mrprompt,項目名稱:silex-api-skel,代碼行數:12,代碼來源:UserTest.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: 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

示例10: 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

示例11: setUp

 /**
  * Boot
  */
 public function setUp()
 {
     parent::setUp();
     $reader = new AnnotationReader();
     $metadataDriver = new AnnotationDriver($reader, Message::class);
     $em = $this->_getTestEntityManager();
     $em->getConfiguration()->setMetadataDriverImpl($metadataDriver);
     $this->obj = new MessageService($em);
     $this->modifyAttribute($this->obj, 'messages', CreateMessageRepositoryMock::getMock());
 }
開發者ID:romeumattos,項目名稱:twitter-like,代碼行數:13,代碼來源:MessageTest.php

示例12: 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

示例13: 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

示例14: 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

示例15: setUp

 function setUp()
 {
     parent::setUp();
     $this->_em = $this->_getTestEntityManager();
 }
開發者ID:jsuggs,項目名稱:BBM_old,代碼行數:5,代碼來源:EntityManagerTest.php


注:本文中的Doctrine\Tests\OrmTestCase::setUp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。