• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Tests\OrmFunctionalTestCase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setUp

 protected function setUp()
 {
     $this->enableSecondLevelCache();
     $this->useModelSet('cache');
     parent::setUp();
     $this->cache = $this->_em->getCache();
 }
开发者ID:selimcr,项目名称:servigases,代码行数:7,代码来源:SecondLevelCacheAbstractTest.php


示例2: setUp

 protected function setUp()
 {
     $this->cacheDataReflection = new \ReflectionProperty("Doctrine\\Common\\Cache\\ArrayCache", "data");
     $this->cacheDataReflection->setAccessible(true);
     $this->useModelSet('cms');
     parent::setUp();
 }
开发者ID:selimcr,项目名称:servigases,代码行数:7,代码来源:QueryCacheTest.php


示例3: setUp

 public function setUp()
 {
     $this->useModelSet('vct_onetomany_extralazy');
     parent::setUp();
     $inversed = new Entity\InversedOneToManyExtraLazyEntity();
     $inversed->id1 = 'abc';
     $owning1 = new Entity\OwningManyToOneExtraLazyEntity();
     $owning1->id2 = 'def';
     $owning2 = new Entity\OwningManyToOneExtraLazyEntity();
     $owning2->id2 = 'ghi';
     $owning3 = new Entity\OwningManyToOneExtraLazyEntity();
     $owning3->id2 = 'jkl';
     $inversed->associatedEntities->add($owning1);
     $owning1->associatedEntity = $inversed;
     $inversed->associatedEntities->add($owning2);
     $owning2->associatedEntity = $inversed;
     $inversed->associatedEntities->add($owning3);
     $owning3->associatedEntity = $inversed;
     $this->_em->persist($inversed);
     $this->_em->persist($owning1);
     $this->_em->persist($owning2);
     $this->_em->persist($owning3);
     $this->_em->flush();
     $this->_em->clear();
 }
开发者ID:selimcr,项目名称:servigases,代码行数:25,代码来源:OneToManyExtraLazyTest.php


示例4: setUp

 protected function setUp()
 {
     $this->enableSecondLevelCache();
     parent::setUp();
     $targetPersister = $this->_em->getUnitOfWork()->getEntityPersister(City::CLASSNAME);
     $this->structure = new DefaultCollectionHydrator($this->_em, $targetPersister);
 }
开发者ID:selimcr,项目名称:servigases,代码行数:7,代码来源:DefaultCollectionHydratorTest.php


示例5: setUp

 protected function setUp()
 {
     parent::setUp();
     if (\extension_loaded('memcache') && @fsockopen('localhost', 11211)) {
         $memcache = new \Memcache();
         $memcache->addServer('localhost');
         $memcache->flush();
         $cacheDriver = new \Doctrine\Common\Cache\MemcacheCache();
         $cacheDriver->setMemcache($memcache);
         $this->_em->getMetadataFactory()->setCacheDriver($cacheDriver);
     } else {
         if (\extension_loaded('apc')) {
             $this->_em->getMetadataFactory()->setCacheDriver(new \Doctrine\Common\Cache\ApcCache());
         } else {
             $this->markTestSkipped('Test only works with a cache enabled.');
         }
     }
     try {
         $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC742User'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC742Comment')));
     } catch (\Exception $e) {
     }
     // make sure classes will be deserialized from caches
     $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\\DDC742User', null);
     $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\\DDC742Comment', null);
 }
开发者ID:pnaq57,项目名称:zf2demo,代码行数:25,代码来源:DDC742Test.php


示例6: setUp

 protected function setUp()
 {
     parent::setUp();
     Type::addType(DDC2012TsVectorType::MYTYPE, __NAMESPACE__ . '\\DDC2012TsVectorType');
     DDC2012TsVectorType::$calls = array();
     $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2012Item'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2012ItemPerson')));
 }
开发者ID:Herriniaina,项目名称:iVarotra,代码行数:7,代码来源:DDC2012Test.php


示例7: tearDown

 public function tearDown()
 {
     parent::tearDown();
     $class = $this->_em->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsUser');
     $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_LAZY;
     $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_LAZY;
 }
开发者ID:pnaq57,项目名称:zf2demo,代码行数:7,代码来源:SQLFilterTest.php


示例8: setUp

 protected function setUp()
 {
     $this->useModelSet('ecommerce');
     $this->useModelSet('company');
     parent::setUp();
     $this->_factory = new ProxyFactory($this->_em, __DIR__ . '/../../Proxies', 'Doctrine\\Tests\\Proxies', true);
 }
开发者ID:selimcr,项目名称:servigases,代码行数:7,代码来源:ReferenceProxyTest.php


示例9: setUp

 protected function setUp()
 {
     $this->useModelSet('taxi');
     parent::setUp();
     list($bimmer, $crysler, $merc, $volvo) = $this->createCars('Doctrine\\Tests\\Models\\Taxi\\Car');
     list($john, $foo) = $this->createDrivers('Doctrine\\Tests\\Models\\Taxi\\Driver');
     $this->_em->flush();
     $ride1 = new Ride($john, $bimmer);
     $ride2 = new Ride($john, $merc);
     $ride3 = new Ride($john, $volvo);
     $ride4 = new Ride($foo, $merc);
     $this->_em->persist($ride1);
     $this->_em->persist($ride2);
     $this->_em->persist($ride3);
     $this->_em->persist($ride4);
     $ride5 = new PaidRide($john, $bimmer);
     $ride5->setFare(10.5);
     $ride6 = new PaidRide($john, $merc);
     $ride6->setFare(16.0);
     $ride7 = new PaidRide($john, $volvo);
     $ride7->setFare(20.7);
     $ride8 = new PaidRide($foo, $merc);
     $ride8->setFare(32.15);
     $this->_em->persist($ride5);
     $this->_em->persist($ride6);
     $this->_em->persist($ride7);
     $this->_em->persist($ride8);
     $this->_em->flush();
 }
开发者ID:Herriniaina,项目名称:iVarotra,代码行数:29,代码来源:DDC1884Test.php


示例10: setUp

 protected function setUp()
 {
     $this->useModelSet('cms');
     $this->useModelSet('company');
     parent::setUp();
     $this->platform = $this->_em->getConnection()->getDatabasePlatform();
 }
开发者ID:relo-san,项目名称:doctrine2,代码行数:7,代码来源:NativeQueryTest.php


示例11: setUp

 protected function setUp()
 {
     parent::setUp();
     DDC2494TinyIntType::$calls = array();
     Type::addType('ddc2494_tinyint', __NAMESPACE__ . '\\DDC2494TinyIntType');
     $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(DDC2494Currency::CLASSNAME), $this->_em->getClassMetadata(DDC2494Campaign::CLASSNAME)));
 }
开发者ID:pnaq57,项目名称:zf2demo,代码行数:7,代码来源:DDC2494Test.php


示例12: tearDown

 public function tearDown()
 {
     if ($this->_em) {
         $this->_em->getConfiguration()->setEntityNamespaces(array());
     }
     parent::tearDown();
 }
开发者ID:relo-san,项目名称:doctrine2,代码行数:7,代码来源:EntityRepositoryTest.php


示例13: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2575Root'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2575A'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2575B')));
     $entityRoot1 = new DDC2575Root(1);
     $entityB1 = new DDC2575B(2);
     $entityA1 = new DDC2575A($entityRoot1, $entityB1);
     $this->_em->persist($entityRoot1);
     $this->_em->persist($entityA1);
     $this->_em->persist($entityB1);
     $entityRoot2 = new DDC2575Root(3);
     $entityB2 = new DDC2575B(4);
     $entityA2 = new DDC2575A($entityRoot2, $entityB2);
     $this->_em->persist($entityRoot2);
     $this->_em->persist($entityA2);
     $this->_em->persist($entityB2);
     $this->_em->flush();
     $this->rootsEntities[] = $entityRoot1;
     $this->rootsEntities[] = $entityRoot2;
     $this->aEntities[] = $entityA1;
     $this->aEntities[] = $entityA2;
     $this->bEntities[] = $entityB1;
     $this->bEntities[] = $entityB2;
     $this->_em->clear();
 }
开发者ID:selimcr,项目名称:servigases,代码行数:25,代码来源:DDC2575Test.php


示例14: setUp

 public function setUp()
 {
     $this->useModelSet('cms');
     parent::setUp();
     $user1 = new CmsUser();
     $user1->username = "beberlei";
     $user1->name = "Benjamin";
     $user1->status = "active";
     $group1 = new CmsGroup();
     $group1->name = "test";
     $group2 = new CmsGroup();
     $group2->name = "test";
     $user1->addGroup($group1);
     $user1->addGroup($group2);
     $user2 = new CmsUser();
     $user2->username = "romanb";
     $user2->name = "Roman";
     $user2->status = "active";
     $this->_em->persist($user1);
     $this->_em->persist($user2);
     $this->_em->persist($group1);
     $this->_em->persist($group2);
     $this->_em->flush();
     $this->_em->clear();
     $this->user1 = $this->_em->find(get_class($user1), $user1->id);
     $this->user2 = $this->_em->find(get_class($user1), $user2->id);
 }
开发者ID:Herriniaina,项目名称:iVarotra,代码行数:27,代码来源:DDC1643Test.php


示例15: setUp

 protected function setUp()
 {
     parent::setUp();
     if ($this->_em->getConnection()->getDatabasePlatform()->getName() !== 'postgresql') {
         $this->markTestSkipped('The ' . __CLASS__ . ' requires the use of postgresql.');
     }
 }
开发者ID:jacques-sounvi,项目名称:addressbook,代码行数:7,代码来源:PostgreSqlSchemaToolTest.php


示例16: setUp

 protected function setUp()
 {
     parent::setUp();
     try {
         $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1209_1'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1209_2'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1209_3')));
     } catch (\Exception $e) {
     }
 }
开发者ID:robertowest,项目名称:CuteFlow-V4,代码行数:8,代码来源:DDC1209Test.php


示例17: setup

 /**
  * {@inheritDoc}
  */
 protected function setup()
 {
     parent::setup();
     $platform = $this->_em->getConnection()->getDatabasePlatform();
     if (!$platform->supportsSchemas() && !$platform->canEmulateSchemas()) {
         $this->markTestSkipped("This test is only useful for databases that support schemas or can emulate them.");
     }
 }
开发者ID:selimcr,项目名称:servigases,代码行数:11,代码来源:DDC2825Test.php


示例18: setUp

 public function setUp()
 {
     parent::setUp();
     try {
         $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC992Role'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC992Parent'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC992Child')));
     } catch (\Exception $e) {
     }
 }
开发者ID:Herriniaina,项目名称:iVarotra,代码行数:8,代码来源:DDC992Test.php


示例19: tearDown

 /**
  * {@inheritdoc}
  */
 protected function tearDown()
 {
     parent::tearDown();
     $connection = $this->_em->getConnection();
     $platform = $connection->getDatabasePlatform();
     // drop sequence manually due to dependency
     $connection->exec($platform->getDropSequenceSQL(new Sequence($platform->getIdentitySequenceName('seq_identity', 'id'))));
 }
开发者ID:selimcr,项目名称:servigases,代码行数:11,代码来源:SequenceEmulatedIdentityStrategyTest.php


示例20: setUp

 public function setUp()
 {
     parent::setUp();
     try {
         $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1113Engine'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1113Vehicle'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1113Car'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1113Bus')));
     } catch (\Exception $e) {
     }
 }
开发者ID:Herriniaina,项目名称:iVarotra,代码行数:8,代码来源:DDC1113Test.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Tests\OrmTestCase类代码示例发布时间:2022-05-23
下一篇:
PHP Pagination\Paginator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap