Rector changes and immplementations of required methods

This commit is contained in:
2025-05-22 17:47:07 +02:00
parent 053b92b77c
commit 17db59d221
1138 changed files with 2656 additions and 2616 deletions

View File

@@ -53,7 +53,7 @@ final class AddressControllerTest extends \Symfony\Bundle\FrameworkBundle\Test\W
/**
* @dataProvider generateAddressIds
*/
public function testDuplicate(int $addressId)
public function testDuplicate(int $addressId): void
{
$this->client = $this->getClientAuthenticated();
$this->client->request('POST', "/api/1.0/main/address/{$addressId}/duplicate.json");

View File

@@ -46,7 +46,7 @@ final class AddressReferenceApiControllerTest extends WebTestCase
/**
* @dataProvider provideData
*/
public function testSearch(int $postCodeId, string $pattern)
public function testSearch(int $postCodeId, string $pattern): void
{
$client = $this->getClientAuthenticated();

View File

@@ -25,7 +25,7 @@ final class ExportControllerTest extends WebTestCase
{
use PrepareClientTrait;
public function testIndex()
public function testIndex(): void
{
$client = $this->getClientAuthenticatedAsAdmin();

View File

@@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response;
*/
final class LoginControllerTest extends WebTestCase
{
public function testLogin()
public function testLogin(): void
{
$client = self::createClient();

View File

@@ -23,7 +23,7 @@ class NewsItemApiControllerTest extends WebTestCase
{
use PrepareClientTrait;
public function testListCurrentNewsItems()
public function testListCurrentNewsItems(): void
{
$client = $this->getClientAuthenticated();

View File

@@ -75,7 +75,7 @@ class NewsItemControllerTest extends WebTestCase
yield [$newsItem];
}
public function testList()
public function testList(): void
{
$client = $this->getClientAuthenticated('admin', 'password');
$client->request('GET', '/fr/admin/news_item');
@@ -86,7 +86,7 @@ class NewsItemControllerTest extends WebTestCase
/**
* @dataProvider generateNewsItemIds
*/
public function testShowSingleItem(NewsItem $newsItem)
public function testShowSingleItem(NewsItem $newsItem): void
{
$client = $this->getClientAuthenticated('admin', 'password');
$client->request('GET', "/fr/admin/news_item/{$newsItem->getId()}/view");

View File

@@ -72,7 +72,7 @@ class NewsItemsHistoryControllerTest extends WebTestCase
yield [$news->getId()];
}
public function testList()
public function testList(): void
{
self::ensureKernelShutdown();
$client = $this->getClientAuthenticated();
@@ -85,7 +85,7 @@ class NewsItemsHistoryControllerTest extends WebTestCase
/**
* @dataProvider generateNewsItemIds
*/
public function testShowSingleItem(int $newsItemId)
public function testShowSingleItem(int $newsItemId): void
{
self::ensureKernelShutdown();
$client = $this->getClientAuthenticated();

View File

@@ -74,7 +74,7 @@ final class NotificationApiControllerTest extends WebTestCase
/**
* @dataProvider generateDataMarkAsRead
*/
public function testMarkAsReadOrUnRead(int $notificationId)
public function testMarkAsReadOrUnRead(int $notificationId): void
{
$client = $this->getClientAuthenticated();
$client->request('POST', "/api/1.0/main/notification/{$notificationId}/mark/read");

View File

@@ -28,7 +28,7 @@ final class PermissionApiControllerTest extends WebTestCase
self::ensureKernelShutdown();
}
public function testDenormalizingObject()
public function testDenormalizingObject(): void
{
// for a unknown reason, the kernel may be booted before running this test...
self::ensureKernelShutdown();
@@ -55,7 +55,7 @@ final class PermissionApiControllerTest extends WebTestCase
$this->assertFalse($data['roles']['FOO_ROLE']);
}
public function testNullObject()
public function testNullObject(): void
{
$client = $this->getClientAuthenticated();

View File

@@ -23,7 +23,7 @@ final class PostalCodeApiControllerTest extends WebTestCase
{
use PrepareClientTrait;
public function testSearch()
public function testSearch(): void
{
$client = $this->getClientAuthenticated();

View File

@@ -23,7 +23,7 @@ final class ScopeControllerTest extends WebTestCase
{
use PrepareClientTrait;
public function testCompleteScenario()
public function testCompleteScenario(): void
{
// Create a new client to browse the application
$client = $this->getClientAuthenticatedAsAdmin();

View File

@@ -38,7 +38,7 @@ final class SearchApiControllerTest extends WebTestCase
/**
* @dataProvider generateSearchData
*/
public function testSearch(string $pattern, array $types)
public function testSearch(string $pattern, array $types): void
{
$client = $this->getClientAuthenticated();

View File

@@ -25,7 +25,7 @@ final class SearchControllerTest extends WebTestCase
{
use PrepareClientTrait;
public function testDomainUnknow()
public function testDomainUnknow(): void
{
$client = $this->getClientAuthenticated();
@@ -42,7 +42,7 @@ final class SearchControllerTest extends WebTestCase
);
}
public function testParsingIncorrect()
public function testParsingIncorrect(): void
{
$client = $this->getClientAuthenticated();
@@ -60,7 +60,7 @@ final class SearchControllerTest extends WebTestCase
* Test the behaviour when no domain is provided in the search pattern :
* the default search should be enabled.
*/
public function testSearchPath()
public function testSearchPath(): void
{
$client = $this->getClientAuthenticated();
@@ -72,7 +72,7 @@ final class SearchControllerTest extends WebTestCase
);
}
public function testSearchPathEmpty()
public function testSearchPathEmpty(): void
{
$client = $this->getClientAuthenticated();
@@ -81,7 +81,7 @@ final class SearchControllerTest extends WebTestCase
$this->assertGreaterThan(0, $crawler->filter('*:contains("Merci de fournir des termes de recherche.")')->count());
}
public function testUnknowName()
public function testUnknowName(): void
{
$client = $this->getClientAuthenticated();

View File

@@ -27,7 +27,7 @@ final class UserApiControllerTest extends WebTestCase
/**
* @depends testIndex
*/
public function testEntity(mixed $existingUser)
public function testEntity(mixed $existingUser): void
{
$client = $this->getClientAuthenticated();
@@ -52,7 +52,7 @@ final class UserApiControllerTest extends WebTestCase
return $data['results'][0];
}
public function testUserCurrentLocation()
public function testUserCurrentLocation(): void
{
$client = $this->getClientAuthenticated();
@@ -61,7 +61,7 @@ final class UserApiControllerTest extends WebTestCase
$this->assertResponseIsSuccessful();
}
public function testWhoami()
public function testWhoami(): void
{
$client = $this->getClientAuthenticated();

View File

@@ -46,7 +46,7 @@ final class UserControllerTest extends WebTestCase
yield [$user->getId(), $user->getUsername()];
}
public function testList()
public function testList(): void
{
$client = $this->getClientAuthenticatedAsAdmin();
@@ -55,7 +55,7 @@ final class UserControllerTest extends WebTestCase
self::assertResponseIsSuccessful();
}
public function testNew()
public function testNew(): void
{
$client = $this->getClientAuthenticated('admin');
@@ -93,7 +93,7 @@ final class UserControllerTest extends WebTestCase
/**
* @dataProvider dataGenerateUserId
*/
public function testUpdate(int $userId, string $username)
public function testUpdate(int $userId, string $username): void
{
$client = $this->getClientAuthenticatedAsAdmin();
$crawler = $client->request('GET', "/fr/admin/main/user/{$userId}/edit");
@@ -114,7 +114,7 @@ final class UserControllerTest extends WebTestCase
/**
* @dataProvider dataGenerateUserId
*/
public function testUpdatePassword(int $userId, mixed $username)
public function testUpdatePassword(int $userId, mixed $username): void
{
$client = $this->getClientAuthenticatedAsAdmin();
$crawler = $client->request('GET', "/fr/admin/user/{$userId}/edit_password");
@@ -135,7 +135,7 @@ final class UserControllerTest extends WebTestCase
$this->isPasswordValid($username, $newPassword);
}
protected function isPasswordValid($username, $password)
protected function isPasswordValid($username, $password): void
{
/** @var \Symfony\Component\PasswordHasher\Hasher\UserPasswordHasher $passwordEncoder */
$passwordEncoder = self::getContainer()

View File

@@ -23,7 +23,7 @@ final class UserProfileControllerTest extends WebTestCase
{
use PrepareClientTrait;
public function testPage()
public function testPage(): void
{
$client = $this->getClientAuthenticated();