PR fixes (public properties & correct letter case in annotations)
This commit is contained in:
parent
00bbf4f523
commit
d2cbd5e872
@ -9,19 +9,9 @@ namespace Doctrine\Tests\Models\Issue5989;
|
|||||||
class Issue5989Employee extends Issue5989Person
|
class Issue5989Employee extends Issue5989Person
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @column(type="simple_array", nullable=true)
|
* @Column(type="simple_array", nullable=true)
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $tags;
|
public $tags;
|
||||||
|
|
||||||
public function getTags()
|
|
||||||
{
|
|
||||||
return $this->tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setTags(array $tags)
|
|
||||||
{
|
|
||||||
$this->tags = $tags;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -9,19 +9,9 @@ namespace Doctrine\Tests\Models\Issue5989;
|
|||||||
class Issue5989Manager extends Issue5989Person
|
class Issue5989Manager extends Issue5989Person
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @column(type="simple_array", nullable=true)
|
* @Column(type="simple_array", nullable=true)
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $tags;
|
public $tags;
|
||||||
|
|
||||||
public function getTags()
|
|
||||||
{
|
|
||||||
return $this->tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setTags(array $tags)
|
|
||||||
{
|
|
||||||
$this->tags = $tags;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -20,10 +20,5 @@ class Issue5989Person
|
|||||||
* @Column(type="integer")
|
* @Column(type="integer")
|
||||||
* @GeneratedValue
|
* @GeneratedValue
|
||||||
*/
|
*/
|
||||||
private $id;
|
public $id;
|
||||||
|
|
||||||
public function getId()
|
|
||||||
{
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -21,20 +21,20 @@ class Issue5989Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
{
|
{
|
||||||
$manager = new Issue5989Manager();
|
$manager = new Issue5989Manager();
|
||||||
|
|
||||||
$managerTags = array('tag1', 'tag2');
|
$managerTags = ['tag1', 'tag2'];
|
||||||
$manager->setTags($managerTags);
|
$manager->tags = $managerTags;
|
||||||
$this->_em->persist($manager);
|
$this->_em->persist($manager);
|
||||||
|
|
||||||
$employee = new Issue5989Employee();
|
$employee = new Issue5989Employee();
|
||||||
|
|
||||||
$employeeTags = array('tag2', 'tag3');
|
$employeeTags =['tag2', 'tag3'];
|
||||||
$employee->setTags($employeeTags);
|
$employee->tags = $employeeTags;
|
||||||
$this->_em->persist($employee);
|
$this->_em->persist($employee);
|
||||||
|
|
||||||
$this->_em->flush();
|
$this->_em->flush();
|
||||||
|
|
||||||
$managerId = $manager->getId();
|
$managerId = $manager->id;
|
||||||
$employeeId = $employee->getId();
|
$employeeId = $employee->id;
|
||||||
|
|
||||||
// clear entity manager so that $repository->find actually fetches them and uses the hydrator
|
// clear entity manager so that $repository->find actually fetches them and uses the hydrator
|
||||||
// instead of just returning the existing managed entities
|
// instead of just returning the existing managed entities
|
||||||
@ -45,7 +45,7 @@ class Issue5989Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
$manager = $repository->find($managerId);
|
$manager = $repository->find($managerId);
|
||||||
$employee = $repository->find($employeeId);
|
$employee = $repository->find($employeeId);
|
||||||
|
|
||||||
static::assertEquals($managerTags, $manager->getTags());
|
static::assertEquals($managerTags, $manager->tags);
|
||||||
static::assertEquals($employeeTags, $employee->getTags());
|
static::assertEquals($employeeTags, $employee->tags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user