for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\Tests\OrmFunctionalTestCase;
/**
* @group GH7854
* @requires PHP >= 7.4
*/
class GH7854Test extends OrmFunctionalTestCase
{
public function setUp()
parent::setUp();
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(GH7854Entity::class),
$this->_em->getClassMetadata(GH7854ValueObject::class),
]
);
}
public function testTypedPropertyContainingEmbeddable() : void
$entity = new GH7854Entity();
$this->_em->persist($entity);
$this->_em->flush();
$this->_em->clear();
$entities = $this->_em->getRepository(GH7854Entity::class)->findAll();
$this->assertEquals($entity, $entities[0]);
* @Entity()
class GH7854Entity
* @Embedded(class=GH7854ValueObject::class)
private GH7854ValueObject $valueObject;
$valueObject
* @Embeddable()
class GH7854ValueObject
/** @Id() @Column(type="integer") @GeneratedValue(strategy="AUTO") */
private int $value;
$value