1
0
mirror of synced 2025-02-02 13:31:45 +03:00

PR fixes (public properties & correct letter case in annotations)

This commit is contained in:
Carl Vuorinen 2016-09-08 11:48:34 +03:00 committed by Marco Pivetta
parent c47c23a101
commit 33e23cdddb
4 changed files with 13 additions and 38 deletions

View File

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

View File

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

View File

@ -20,10 +20,5 @@ class Issue5989Person
* @Column(type="integer")
* @GeneratedValue
*/
private $id;
public function getId()
{
return $this->id;
}
public $id;
}

View File

@ -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);
}
}