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