1
0
mirror of synced 2024-12-05 03:06:05 +03:00

Completed test coverage for DDC-3634

This commit is contained in:
Marco Pivetta 2015-03-23 23:37:36 +00:00
parent cbdf23ca65
commit 4c119c44a1

View File

@ -19,6 +19,8 @@ class DDC3634Test extends OrmFunctionalTestCase {
try {
$this->_schemaTool->createSchema([
$this->_em->getClassMetadata(DDC3634Entity::CLASSNAME),
$this->_em->getClassMetadata(DDC3634JTIBaseEntity::CLASSNAME),
$this->_em->getClassMetadata(DDC3634JTIChildEntity::CLASSNAME),
]);
} catch (ToolsException $e) {
// schema already in place
@ -51,6 +53,16 @@ class DDC3634Test extends OrmFunctionalTestCase {
$this->assertInternalType('string', $entity->id);
}
public function testSavesIntegerAutoGeneratedValueAsStringWithJoinedInheritance()
{
$entity = new DDC3634JTIChildEntity();
$this->_em->persist($entity);
$this->_em->flush();
$this->assertInternalType('string', $entity->id);
}
}
/** @Entity */
@ -62,6 +74,28 @@ class DDC3634Entity
public $id;
}
/**
* @Entity
* @InheritanceType("JOINED")
* @DiscriminatorMap({
* DDC3634JTIBaseEntity::class = DDC3634JTIBaseEntity::class,
* DDC3634JTIChildEntity::class = DDC3634JTIChildEntity::class,
* })
*/
class DDC3634JTIBaseEntity
{
const CLASSNAME = __CLASS__;
/** @Id @Column(type="bigint") @GeneratedValue(strategy="AUTO") */
public $id;
}
/** @Entity */
class DDC3634JTIChildEntity extends DDC3634JTIBaseEntity
{
const CLASSNAME = __CLASS__;
}
class DDC3634LastInsertIdMockingConnection extends Connection
{
/**