本文整理汇总了PHP中Doctrine\Tests\OrmFunctionalTestCase::setup方法的典型用法代码示例。如果您正苦于以下问题:PHP OrmFunctionalTestCase::setup方法的具体用法?PHP OrmFunctionalTestCase::setup怎么用?PHP OrmFunctionalTestCase::setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\Tests\OrmFunctionalTestCase
的用法示例。
在下文中一共展示了OrmFunctionalTestCase::setup方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup
protected function setup()
{
parent::setup();
try {
$this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2230User'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2230Address')));
} catch (ToolsException $e) {
}
}
示例2: 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.");
}
}
示例3: setup
/**
* {@inheritDoc}
*/
protected function setup()
{
parent::setup();
try {
$this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2692Foo')));
} catch (\Exception $e) {
return;
}
$this->_em->clear();
}
示例4: setup
/**
* {@inheritDoc}
*/
protected function setup()
{
parent::setup();
try {
$this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2660Product'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2660Customer'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2660CustomerOrder')));
} catch (\Exception $e) {
return;
}
for ($i = 0; $i < 5; $i++) {
$product = new DDC2660Product();
$customer = new DDC2660Customer();
$order = new DDC2660CustomerOrder($product, $customer, 'name' . $i);
$this->_em->persist($product);
$this->_em->persist($customer);
$this->_em->flush();
$this->_em->persist($order);
$this->_em->flush();
}
$this->_em->clear();
}
示例5: setup
/**
* {@inheritDoc}
*/
protected function setup()
{
parent::setup();
try {
$this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2759Qualification'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2759Category'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2759QualificationMetadata'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2759MetadataCategory')));
} catch (\Exception $e) {
return;
}
$qualification = new DDC2759Qualification();
$qualificationMetadata = new DDC2759QualificationMetadata($qualification);
$category1 = new DDC2759Category();
$category2 = new DDC2759Category();
$metadataCategory1 = new DDC2759MetadataCategory($qualificationMetadata, $category1);
$metadataCategory2 = new DDC2759MetadataCategory($qualificationMetadata, $category2);
$this->_em->persist($qualification);
$this->_em->persist($qualificationMetadata);
$this->_em->persist($category1);
$this->_em->persist($category2);
$this->_em->persist($metadataCategory1);
$this->_em->persist($metadataCategory2);
$this->_em->flush();
$this->_em->clear();
}
示例6: setup
/**
* {@inheritDoc}
*/
protected function setup()
{
parent::setup();
$this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC3170AbstractEntityJoined'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC3170ProductJoined'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC3170AbstractEntitySingleTable'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC3170ProductSingleTable')));
}
示例7: setup
protected function setup()
{
parent::setup();
$this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2256User'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2256Group')));
}
示例8: setup
/**
* {@inheritDoc}
*/
protected function setup()
{
parent::setup();
$this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2346Foo'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2346Bar'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC2346Baz')));
$this->logger = new DebugStack();
}