1
0
mirror of synced 2025-02-03 13:59:27 +03:00

71 lines
1.5 KiB
PHP
Raw Normal View History

2009-12-18 12:30:19 +00:00
<?php
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\Tests\OrmFunctionalTestCase;
class DDC144Test extends OrmFunctionalTestCase
2009-12-18 12:30:19 +00:00
{
protected function setUp() {
parent::setUp();
2011-12-19 22:56:19 +01:00
$this->_schemaTool->createSchema(
[
2017-05-31 07:59:04 +02:00
$this->_em->getClassMetadata(DDC144FlowElement::class),
$this->_em->getClassMetadata(DDC144Operand::class),
]
);
2011-12-19 22:56:19 +01:00
2009-12-18 12:30:19 +00:00
}
2011-12-19 22:56:19 +01:00
2009-12-18 12:30:19 +00:00
/**
* @group DDC-144
*/
public function testIssue()
{
$operand = new DDC144Operand;
$operand->property = 'flowValue';
$operand->operandProperty = 'operandValue';
2017-05-31 07:59:04 +02:00
2009-12-18 12:30:19 +00:00
$this->_em->persist($operand);
$this->_em->flush();
2011-12-19 22:56:19 +01:00
self::assertSame($operand, $this->_em->find(DDC144Operand::class, $operand->id));
2009-12-18 12:30:19 +00:00
}
}
/**
* @Entity
* @Table(name="ddc144_flowelements")
* @InheritanceType("JOINED")
* @DiscriminatorColumn(type="string", name="discr")
* @DiscriminatorMap({"flowelement" = "DDC144FlowElement", "operand" = "DDC144Operand"})
*/
2017-05-31 07:59:04 +02:00
class DDC144FlowElement
{
2009-12-18 12:30:19 +00:00
/**
2010-04-10 00:00:36 +02:00
* @Id @Column(type="integer") @GeneratedValue
* @var int
2009-12-18 12:30:19 +00:00
*/
public $id;
2017-05-31 07:59:04 +02:00
2010-04-10 00:00:36 +02:00
/** @Column */
2009-12-18 12:30:19 +00:00
public $property;
}
2017-05-31 07:59:04 +02:00
abstract class DDC144Expression extends DDC144FlowElement
{
abstract public function method();
2009-12-18 12:30:19 +00:00
}
2010-04-10 00:00:36 +02:00
2009-12-18 12:30:19 +00:00
/** @Entity @Table(name="ddc144_operands") */
2017-05-31 07:59:04 +02:00
class DDC144Operand extends DDC144Expression
{
2010-04-10 00:00:36 +02:00
/** @Column */
2009-12-18 12:30:19 +00:00
public $operandProperty;
2017-05-31 07:59:04 +02:00
public function method()
{
}
2009-12-18 12:30:19 +00:00
}