Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / ORM / Entity / ConstructorTest.php
1 <?php
2
3 namespace Doctrine\Tests\ORM\Entity;
4
5 require_once __DIR__ . '/../../TestInit.php';
6
7 class ConstructorTest extends \Doctrine\Tests\OrmTestCase
8 {
9     public function testFieldInitializationInConstructor()
10     {
11         $entity = new ConstructorTestEntity1("romanb");
12         $this->assertEquals("romanb", $entity->username);
13     }
14 }
15
16 class ConstructorTestEntity1
17 {
18     private $id;
19     public $username;
20
21     public function __construct($username = null)
22     {
23         if ($username !== null) {
24             $this->username = $username;
25         }
26     }
27 }
28