Recover changes in ClassMetadataFactoryTest::_createValidClassMetadata() lost during last merge
This commit is contained in:
parent
59e9d55077
commit
b09201ae88
@ -205,18 +205,19 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
{
|
{
|
||||||
// Self-made metadata
|
// Self-made metadata
|
||||||
$cm1 = new ClassMetadata('Doctrine\Tests\ORM\Mapping\TestEntity1');
|
$cm1 = new ClassMetadata('Doctrine\Tests\ORM\Mapping\TestEntity1');
|
||||||
|
$cm1->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService);
|
||||||
$cm1->setPrimaryTable(array('name' => '`group`'));
|
$cm1->setPrimaryTable(array('name' => '`group`'));
|
||||||
// Add a mapped field
|
// Add a mapped field
|
||||||
$cm1->mapField(array('fieldName' => 'name', 'type' => 'varchar'));
|
$cm1->mapField(array('fieldName' => 'name', 'type' => 'varchar'));
|
||||||
// Add a mapped field
|
// Add a mapped field
|
||||||
$cm1->mapField(array('fieldName' => 'id', 'type' => 'integer', 'id' => true));
|
$cm1->mapField(array('fieldName' => 'id', 'type' => 'integer', 'id' => true));
|
||||||
// and a mapped association
|
// and a mapped association
|
||||||
$cm1->mapOneToOne(array('fieldName' => 'other', 'targetEntity' => 'Other', 'mappedBy' => 'this'));
|
$cm1->mapOneToOne(array('fieldName' => 'other', 'targetEntity' => 'TestEntity1', 'mappedBy' => 'this'));
|
||||||
// and an association on the owning side
|
// and an association on the owning side
|
||||||
$joinColumns = array(
|
$joinColumns = array(
|
||||||
array('name' => 'other_id', 'referencedColumnName' => 'id')
|
array('name' => 'other_id', 'referencedColumnName' => 'id')
|
||||||
);
|
);
|
||||||
$cm1->mapOneToOne(array('fieldName' => 'association', 'targetEntity' => 'Other', 'joinColumns' => $joinColumns));
|
$cm1->mapOneToOne(array('fieldName' => 'association', 'targetEntity' => 'TestEntity1', 'joinColumns' => $joinColumns));
|
||||||
// and an id generator type
|
// and an id generator type
|
||||||
$cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO);
|
$cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO);
|
||||||
return $cm1;
|
return $cm1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user