DDC588Test.php 937B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Doctrine\Tests\ORM\Functional\Ticket;
  3. require_once __DIR__ . '/../../../TestInit.php';
  4. class DDC588Test extends \Doctrine\Tests\OrmFunctionalTestCase
  5. {
  6. protected function setUp()
  7. {
  8. parent::setUp();
  9. $this->_schemaTool->createSchema(array(
  10. $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC588Site'),
  11. ));
  12. }
  13. public function testIssue()
  14. {
  15. $site = new DDC588Site('Foo');
  16. $this->_em->persist($site);
  17. $this->_em->flush();
  18. // Following should not result in exception
  19. $this->_em->refresh($site);
  20. }
  21. }
  22. /**
  23. * @Entity
  24. */
  25. class DDC588Site
  26. {
  27. /**
  28. * @Id
  29. * @Column(type="integer", name="site_id")
  30. * @GeneratedValue
  31. */
  32. public $id;
  33. /**
  34. * @Column(type="string", length=45)
  35. */
  36. protected $name = null;
  37. public function __construct($name = '')
  38. {
  39. $this->name = $name;
  40. }
  41. }