apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -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'));