mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-05 21:09:43 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class LoginControllerTest extends WebTestCase
|
||||
@@ -24,7 +25,7 @@ final class LoginControllerTest extends WebTestCase
|
||||
{
|
||||
$client = self::createClient();
|
||||
|
||||
//load login page and submit form
|
||||
// load login page and submit form
|
||||
$crawler = $client->request('GET', '/login');
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
@@ -36,15 +37,15 @@ final class LoginControllerTest extends WebTestCase
|
||||
'_password' => 'password',
|
||||
]);
|
||||
|
||||
//the response is a redirection
|
||||
// the response is a redirection
|
||||
$this->assertTrue($client->getResponse()->isRedirect());
|
||||
|
||||
//the response is not a login page, but on a new page
|
||||
// the response is not a login page, but on a new page
|
||||
$this->assertDoesNotMatchRegularExpression('/\/login$/', $client->getResponse()
|
||||
->headers
|
||||
->get('location'));
|
||||
|
||||
//on the home page, there must be a logout link
|
||||
// on the home page, there must be a logout link
|
||||
$client->followRedirects(true);
|
||||
$crawler = $client->request('GET', '/');
|
||||
|
||||
@@ -52,17 +53,17 @@ final class LoginControllerTest extends WebTestCase
|
||||
->getContent());
|
||||
$logoutLinkFilter = $crawler->filter('a:contains("Se déconnecter")');
|
||||
|
||||
//check there is > 0 logout link
|
||||
// check there is > 0 logout link
|
||||
$this->assertGreaterThan(0, $logoutLinkFilter->count(), 'check that a logout link is present');
|
||||
|
||||
//click on logout link
|
||||
// click on logout link
|
||||
$client->followRedirects(false);
|
||||
$client->click($crawler->selectLink('Se déconnecter')->link());
|
||||
|
||||
$this->assertTrue($client->getResponse()->isRedirect());
|
||||
$client->followRedirect(); //redirect to login page
|
||||
$client->followRedirect(); // redirect to login page
|
||||
|
||||
//check we are back on login page
|
||||
// check we are back on login page
|
||||
$this->assertMatchesRegularExpression('/\/login$/', $client->getResponse()
|
||||
->headers
|
||||
->get('location'));
|
||||
|
Reference in New Issue
Block a user