Added coverage to DDC-1587.
This commit is contained in:
parent
fdb2b9c655
commit
0f07044836
@ -109,6 +109,19 @@ class SchemaValidatorTest extends \Doctrine\Tests\OrmTestCase
|
||||
$ce
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group DDC-1587
|
||||
*/
|
||||
public function testValidOneToOneAsIdentifierSchema()
|
||||
{
|
||||
$class1 = $this->em->getClassMetadata(__NAMESPACE__ . '\DDC1587ValidEntity2');
|
||||
$class2 = $this->em->getClassMetadata(__NAMESPACE__ . '\DDC1587ValidEntity1');
|
||||
|
||||
$ce = $this->validator->validateClass($class1);
|
||||
|
||||
$this->assertEquals(array(), $ce);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -154,3 +167,57 @@ class InvalidEntity2
|
||||
*/
|
||||
protected $assoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Entity(repositoryClass="Entity\Repository\Agent")
|
||||
* @Table(name="agent")
|
||||
*/
|
||||
class DDC1587ValidEntity1
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @Id @GeneratedValue
|
||||
* @Column(name="pk", type="integer")
|
||||
*/
|
||||
private $pk;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @Column(name="name", type="string", length=32)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var Identifier
|
||||
*
|
||||
* @OneToOne(targetEntity="DDC1587ValidEntity2", cascade={"all"}, mappedBy="agent")
|
||||
* @JoinColumn(name="pk", referencedColumnName="pk_agent")
|
||||
*/
|
||||
private $identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table
|
||||
*/
|
||||
class DDC1587ValidEntity2
|
||||
{
|
||||
/**
|
||||
* @var DDC1587ValidEntity1
|
||||
*
|
||||
* @Id
|
||||
* @OneToOne(targetEntity="DDC1587ValidEntity1", inversedBy="identifier")
|
||||
* @JoinColumn(name="pk_agent", referencedColumnName="pk", nullable=false)
|
||||
*/
|
||||
private $agent;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @Column(name="num", type="string", length=16, nullable=true)
|
||||
*/
|
||||
private $num;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user