DDC425Test.php 1.1 KB

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