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