Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / ORM / Functional / Ticket / DDC425Test.php
1 <?php
2 namespace Doctrine\Tests\ORM\Functional\Ticket;
3
4 require_once __DIR__ . '/../../../TestInit.php';
5
6 use DateTime, Doctrine\DBAL\Types\Type;
7
8 class DDC425Test extends \Doctrine\Tests\OrmFunctionalTestCase
9 {
10     protected function setUp()
11     {
12         parent::setUp();
13         $this->_schemaTool->createSchema(array(
14             $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC425Entity'),
15             //$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC425Other')
16         ));
17     }
18
19     /**
20      * @group DDC-425
21      */
22     public function testIssue()
23     {
24         //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
25
26         $num = $this->_em->createQuery('DELETE '.__NAMESPACE__.'\DDC425Entity e WHERE e.someDatetimeField > ?1')
27                 ->setParameter(1, new DateTime, Type::DATETIME)
28                 ->getResult();
29         $this->assertEquals(0, $num);
30     }
31 }
32
33 /** @Entity */
34 class DDC425Entity {
35     /**
36      * @Id @Column(type="integer")
37      * @GeneratedValue
38      */
39     public $id;
40
41     /** @Column(type="datetime") */
42     public $someDatetimeField;
43 }