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