mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
fix tests for chill main
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user