Rajout de doctrine/orm
[zf2.biz/application_blanche.git] / vendor / doctrine / orm / tests / Doctrine / Tests / ORM / Entity / ConstructorTest.php
diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php
new file mode 100644 (file)
index 0000000..014a7b4
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+namespace Doctrine\Tests\ORM\Entity;
+
+require_once __DIR__ . '/../../TestInit.php';
+
+class ConstructorTest extends \Doctrine\Tests\OrmTestCase
+{
+    public function testFieldInitializationInConstructor()
+    {
+        $entity = new ConstructorTestEntity1("romanb");
+        $this->assertEquals("romanb", $entity->username);
+    }
+}
+
+class ConstructorTestEntity1
+{
+    private $id;
+    public $username;
+
+    public function __construct($username = null)
+    {
+        if ($username !== null) {
+            $this->username = $username;
+        }
+    }
+}
+