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


PHP OrmFunctionalTestCase::setUp方法代码示例

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


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

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

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

示例3: setUp

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

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

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

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

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

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

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

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

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

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

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

示例14: setUp

 protected function setUp()
 {
     parent::setUp();
     try {
         $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1400Article'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1400User'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1400UserState')));
     } catch (\Exception $ignored) {
     }
 }
开发者ID:selimcr,项目名称:servigases,代码行数:8,代码来源:DDC1400Test.php

示例15: setUp

 protected function setUp()
 {
     parent::setUp();
     try {
         $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\PersistentCollectionHolder'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\PersistentCollectionContent')));
     } catch (\Exception $e) {
     }
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:8,代码来源:PersistentCollectionTest.php


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