mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
parent
72182a8c77
commit
aa8d211e55
@ -134,6 +134,30 @@ class PersonControllerUpdateTest extends WebTestCase
|
|||||||
'the value '.$field.' is updated in db');
|
'the value '.$field.' is updated in db');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testEditLanguages()
|
||||||
|
{
|
||||||
|
$crawler = $this->client->request('GET', $this->editUrl);
|
||||||
|
$selectedLanguages = array('en', 'an', 'bbj');
|
||||||
|
|
||||||
|
$form = $crawler->selectButton('Submit')
|
||||||
|
->form();
|
||||||
|
$form->get('chill_personbundle_person[spokenLanguages]')
|
||||||
|
->setValue($selectedLanguages);
|
||||||
|
|
||||||
|
$this->client->submit($form);
|
||||||
|
$this->em->refresh($this->person);
|
||||||
|
|
||||||
|
$this->assertTrue($this->client->getResponse()->isRedirect($this->seeUrl),
|
||||||
|
'the page is redirected to /general view');
|
||||||
|
//retrieve languages codes present in person
|
||||||
|
foreach($this->person->getSpokenLanguages() as $lang){
|
||||||
|
$languagesCodesPresents[] = $lang->getId();
|
||||||
|
}
|
||||||
|
$this->assertEquals(asort($selectedLanguages), asort($languagesCodesPresents),
|
||||||
|
'the person speaks the expected languages');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user