作者:selimc
项目:servigase
protected function setUp()
{
$this->enableSecondLevelCache();
$this->useModelSet('cache');
parent::setUp();
$this->cache = $this->_em->getCache();
}
作者:selimc
项目:servigase
protected function setUp()
{
$this->cacheDataReflection = new \ReflectionProperty("Doctrine\\Common\\Cache\\ArrayCache", "data");
$this->cacheDataReflection->setAccessible(true);
$this->useModelSet('cms');
parent::setUp();
}
作者:selimc
项目:servigase
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();
}
作者:selimc
项目:servigase
protected function setUp()
{
$this->enableSecondLevelCache();
parent::setUp();
$targetPersister = $this->_em->getUnitOfWork()->getEntityPersister(City::CLASSNAME);
$this->structure = new DefaultCollectionHydrator($this->_em, $targetPersister);
}
作者:pnaq5
项目:zf2dem
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);
}
作者:Herriniain
项目:iVarotr
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')));
}
作者:pnaq5
项目:zf2dem
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;
}
作者:selimc
项目:servigase
protected function setUp()
{
$this->useModelSet('ecommerce');
$this->useModelSet('company');
parent::setUp();
$this->_factory = new ProxyFactory($this->_em, __DIR__ . '/../../Proxies', 'Doctrine\\Tests\\Proxies', true);
}
作者:Herriniain
项目:iVarotr
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();
}
作者:relo-sa
项目:doctrine
protected function setUp()
{
$this->useModelSet('cms');
$this->useModelSet('company');
parent::setUp();
$this->platform = $this->_em->getConnection()->getDatabasePlatform();
}
作者:pnaq5
项目:zf2dem
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)));
}
作者:relo-sa
项目:doctrine
public function tearDown()
{
if ($this->_em) {
$this->_em->getConfiguration()->setEntityNamespaces(array());
}
parent::tearDown();
}
作者:selimc
项目:servigase
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();
}
作者:Herriniain
项目:iVarotr
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);
}
作者:jacques-sounv
项目:addressboo
protected function setUp()
{
parent::setUp();
if ($this->_em->getConnection()->getDatabasePlatform()->getName() !== 'postgresql') {
$this->markTestSkipped('The ' . __CLASS__ . ' requires the use of postgresql.');
}
}
作者:robertowes
项目:CuteFlow-V
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) {
}
}
作者:selimc
项目:servigase
/**
* {@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.");
}
}
作者:Herriniain
项目:iVarotr
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) {
}
}
作者:selimc
项目:servigase
/**
* {@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'))));
}
作者:Herriniain
项目:iVarotr
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) {
}
}