fix tests for chill main

This commit is contained in:
2021-04-27 16:33:44 +02:00
parent 66426f5102
commit 7596bd5a06
16 changed files with 38 additions and 332 deletions

View File

@@ -9,15 +9,7 @@ class LoginControllerTest extends WebTestCase
{
public function testLogin()
{
$client = static::createClient(array(
'framework' => array(
'default_locale' => 'en',
'translator' => array(
'fallback' => 'en'
)
),
));
$client = static::createClient();
//load login page and submit form
$crawler = $client->request('GET', '/login');
@@ -42,17 +34,17 @@ class LoginControllerTest extends WebTestCase
//on the home page, there must be a logout link
$client->followRedirects(true);
$crawler = $client->request('GET', '/');
$this->assertRegExp('/center a_social/', $client->getResponse()
->getContent());
$logoutLinkFilter = $crawler->filter('a:contains("Logout")');
$logoutLinkFilter = $crawler->filter('a:contains("Se déconnecter")');
//check there is > 0 logout link
$this->assertGreaterThan(0, $logoutLinkFilter->count(), 'check that a logout link is present');
//click on logout link
$client->followRedirects(false);
$client->click($crawler->selectLink('Logout')->link());
$client->click($crawler->selectLink('Se déconnecter')->link());
$this->assertTrue($client->getResponse()->isRedirect());
$client->followRedirect(); #redirect to login page