DDC144Test.php 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace Doctrine\Tests\ORM\Functional\Ticket;
  3. require_once __DIR__ . '/../../../TestInit.php';
  4. class DDC144Test extends \Doctrine\Tests\OrmFunctionalTestCase
  5. {
  6. protected function setUp() {
  7. parent::setUp();
  8. //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
  9. $this->_schemaTool->createSchema(array(
  10. $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144FlowElement'),
  11. // $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144Expression'),
  12. $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144Operand'),
  13. ));
  14. }
  15. /**
  16. * @group DDC-144
  17. */
  18. public function testIssue()
  19. {
  20. $operand = new DDC144Operand;
  21. $operand->property = 'flowValue';
  22. $operand->operandProperty = 'operandValue';
  23. $this->_em->persist($operand);
  24. $this->_em->flush();
  25. }
  26. }
  27. /**
  28. * @Entity
  29. * @Table(name="ddc144_flowelements")
  30. * @InheritanceType("JOINED")
  31. * @DiscriminatorColumn(type="string", name="discr")
  32. * @DiscriminatorMap({"flowelement" = "DDC144FlowElement", "operand" = "DDC144Operand"})
  33. */
  34. class DDC144FlowElement {
  35. /**
  36. * @Id @Column(type="integer") @GeneratedValue
  37. * @var integer
  38. */
  39. public $id;
  40. /** @Column */
  41. public $property;
  42. }
  43. abstract class DDC144Expression extends DDC144FlowElement {
  44. abstract function method();
  45. }
  46. /** @Entity @Table(name="ddc144_operands") */
  47. class DDC144Operand extends DDC144Expression {
  48. /** @Column */
  49. public $operandProperty;
  50. function method() {}
  51. }