mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-02 23:16:13 +00:00
fix refreshing person problem
the entity "person" wasn't managed any more by the ORM, for an unknow reason.
This commit is contained in:
parent
e2e89d433f
commit
008cb5b216
@ -76,6 +76,16 @@ class PersonControllerUpdateTest extends WebTestCase
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
protected function refreshPerson()
|
||||
{
|
||||
$this->person = $this->em->getRepository('ChillPersonBundle:Person')
|
||||
->find($this->person->getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the edit page exist and rendering is successful
|
||||
*/
|
||||
@ -126,7 +136,7 @@ class PersonControllerUpdateTest extends WebTestCase
|
||||
->setValue($transformedValue);
|
||||
|
||||
$this->client->submit($form);
|
||||
$this->em->refresh($this->person);
|
||||
$this->refreshPerson();
|
||||
|
||||
$this->assertTrue($this->client->getResponse()->isRedirect($this->seeUrl),
|
||||
'the page is redirected to general view');
|
||||
@ -145,7 +155,7 @@ class PersonControllerUpdateTest extends WebTestCase
|
||||
->setValue($selectedLanguages);
|
||||
|
||||
$this->client->submit($form);
|
||||
$this->em->refresh($this->person);
|
||||
$this->refreshPerson();
|
||||
|
||||
$this->assertTrue($this->client->getResponse()->isRedirect($this->seeUrl),
|
||||
'the page is redirected to /general view');
|
||||
@ -222,6 +232,7 @@ class PersonControllerUpdateTest extends WebTestCase
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
$this->refreshPerson();
|
||||
$this->em->remove($this->person);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user