1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php
2009-01-24 16:56:44 +00:00

29 lines
570 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;
}
}
}