1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php
2011-12-19 22:56:19 +01:00

29 lines
561 B
PHP

<?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;
}
}
}