Ticket2481Test.php 986 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Doctrine\Tests\ORM\Functional\Ticket;
  3. require_once __DIR__ . '/../../../TestInit.php';
  4. class Ticket2481Test extends \Doctrine\Tests\OrmFunctionalTestCase
  5. {
  6. protected function setUp()
  7. {
  8. parent::setUp();
  9. try {
  10. $this->_schemaTool->createSchema(array(
  11. $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Ticket\Ticket2481Product')
  12. ));
  13. } catch (\Exception $e) {
  14. // Swallow all exceptions. We do not test the schema tool here.
  15. }
  16. $this->_conn = $this->_em->getConnection();
  17. }
  18. public function testEmptyInsert()
  19. {
  20. $test = new Ticket2481Product();
  21. $this->_em->persist($test);
  22. $this->_em->flush();
  23. $this->assertTrue($test->id > 0);
  24. }
  25. }
  26. /**
  27. * @Entity
  28. * @Table(name="ticket_2481_products")
  29. */
  30. class Ticket2481Product
  31. {
  32. /**
  33. * @Id @Column(type="integer")
  34. * @GeneratedValue(strategy="AUTO")
  35. */
  36. public $id;
  37. }