3 namespace Doctrine\Tests\ORM\Entity;
5 require_once __DIR__ . '/../../TestInit.php';
7 class ConstructorTest extends \Doctrine\Tests\OrmTestCase
9 public function testFieldInitializationInConstructor()
11 $entity = new ConstructorTestEntity1("romanb");
12 $this->assertEquals("romanb", $entity->username);
16 class ConstructorTestEntity1
21 public function __construct($username = null)
23 if ($username !== null) {
24 $this->username = $username;