Fix some tests

This commit is contained in:
2023-12-14 21:18:00 +01:00
parent d5476df14c
commit 2dd1b7c943
11 changed files with 92 additions and 127 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Tests\Controller;
use Chill\MainBundle\Test\PrepareClientTrait;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
@@ -20,14 +21,12 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class ScopeControllerTest extends WebTestCase
{
use PrepareClientTrait;
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = self::createClient([], [
'PHP_AUTH_USER' => 'admin',
'PHP_AUTH_PW' => 'password',
'HTTP_ACCEPT_LANGUAGE' => 'fr_FR',
]);
$client = $this->getClientAuthenticatedAsAdmin();
// Create a new entry in the database
$crawler = $client->request('GET', '/fr/admin/scope/');
@@ -69,7 +68,9 @@ final class ScopeControllerTest extends WebTestCase
'chill_mainbundle_scope[name][en]' => 'Foo en',
]);
$client->submit($form);
$crawler = $client->submit($form);
var_dump($client->getResponse()->getStatusCode());
var_dump($crawler->text());
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"