Remove deprecation linked to kernel shutdown

This commit is contained in:
2023-08-31 18:36:37 +02:00
parent 7c58880139
commit 6f11dffcbd
23 changed files with 166 additions and 85 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Search;
use Chill\MainBundle\Test\PrepareClientTrait;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
@@ -21,6 +22,13 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
final class PersonSearchTest extends WebTestCase
{
use PrepareClientTrait;
protected function tearDown(): void
{
self::ensureKernelShutdown();
}
public function testDefaultAccented(): never
{
$this->markTestSkipped('skipped until adapted to new fixtures');
@@ -69,6 +77,8 @@ final class PersonSearchTest extends WebTestCase
$this->assertMatchesRegularExpression('/MANÇO/', $crawlerSpecial->filter('.list-with-period')->text());
self::ensureKernelShutdown();
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person lastname:manco');
$this->assertMatchesRegularExpression('/MANÇO/', $crawlerNoSpecial->filter('.list-with-period')->text());
@@ -95,6 +105,8 @@ final class PersonSearchTest extends WebTestCase
$this->assertMatchesRegularExpression('/Gérard/', $crawlerSpecial->filter('.list-with-period')->text());
self::ensureKernelShutdown();
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person firstname:Gerard');
$this->assertMatchesRegularExpression('/Gérard/', $crawlerNoSpecial->filter('.list-with-period')->text());
@@ -197,13 +209,15 @@ final class PersonSearchTest extends WebTestCase
public function testSearchWithAuthorization()
{
$crawlerCanSee = $this->generateCrawlerForSearch('Gérard', 'center a_social');
$crawlerCannotSee = $this->generateCrawlerForSearch('Gérard', 'center b_social');
$this->assertMatchesRegularExpression(
'/DEPARDIEU/',
$crawlerCanSee->text(),
'center a_social may see "Depardieu" in center a'
);
self::ensureKernelShutdown();
$crawlerCannotSee = $this->generateCrawlerForSearch('Gérard', 'center b_social');
$this->assertDoesNotMatchRegularExpression(
'/DEPARDIEU/',
$crawlerCannotSee->text(),
@@ -229,9 +243,6 @@ final class PersonSearchTest extends WebTestCase
*/
private function getAuthenticatedClient(mixed $username = 'center a_social')
{
return self::createClient([], [
'PHP_AUTH_USER' => $username,
'PHP_AUTH_PW' => 'password',
]);
return $this->getClientAuthenticated($username);
}
}