mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
upgrade phpunit: make data provider static
This commit is contained in:
@@ -32,7 +32,7 @@ final class AddressControllerTest extends \Symfony\Bundle\FrameworkBundle\Test\W
|
||||
self::ensureKernelShutdown();
|
||||
}
|
||||
|
||||
public function generateAddressIds(): iterable
|
||||
public static function generateAddressIds(): iterable
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
@@ -25,7 +25,7 @@ final class AddressReferenceApiControllerTest extends WebTestCase
|
||||
{
|
||||
use PrepareClientTrait;
|
||||
|
||||
public function provideData()
|
||||
public static function provideData()
|
||||
{
|
||||
self::bootKernel();
|
||||
/** @var EntityManagerInterface $em */
|
||||
|
@@ -24,7 +24,7 @@ final class SearchApiControllerTest extends WebTestCase
|
||||
{
|
||||
use PrepareClientTrait;
|
||||
|
||||
public function generateSearchData()
|
||||
public static function generateSearchData()
|
||||
{
|
||||
yield ['per', ['person', 'thirdparty']];
|
||||
|
||||
|
@@ -31,7 +31,7 @@ final class AgeTest extends KernelTestCase
|
||||
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
}
|
||||
|
||||
public function generateQueries(): iterable
|
||||
public static function generateQueries(): iterable
|
||||
{
|
||||
yield [
|
||||
'SELECT AGE(a.validFrom, a.validTo) FROM '.Address::class.' a',
|
||||
|
@@ -51,7 +51,7 @@ class JsonBuildObjectTest extends KernelTestCase
|
||||
self::assertIsArray($result);
|
||||
}
|
||||
|
||||
public function provideQueries(): iterable
|
||||
public static function provideQueries(): iterable
|
||||
{
|
||||
yield ['SELECT JSON_BUILD_OBJECT(1, 2, 3, 4) FROM '.Address::class.' a', [], []];
|
||||
yield ["SELECT JSON_BUILD_OBJECT('st', a.street, 'sn', a.streetNumber) FROM ".Address::class.' a', [], []];
|
||||
|
@@ -31,7 +31,7 @@ final class JsonExtractTest extends KernelTestCase
|
||||
$this->em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
}
|
||||
|
||||
public function dataGenerateDql(): iterable
|
||||
public static function dataGenerateDql(): iterable
|
||||
{
|
||||
yield ['SELECT JSON_EXTRACT(c.name, \'fr\') FROM '.Country::class.' c', []];
|
||||
|
||||
|
@@ -44,7 +44,7 @@ final class NotificationTest extends KernelTestCase
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
public function generateNotificationData()
|
||||
public static function generateNotificationData()
|
||||
{
|
||||
self::bootKernel();
|
||||
$userRepository = self::getContainer()->get(UserRepository::class);
|
||||
|
@@ -43,7 +43,7 @@ final class PageTest extends KernelTestCase
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function generateGetFirstItemNumber()
|
||||
public static function generateGetFirstItemNumber()
|
||||
{
|
||||
return [
|
||||
[1, 10, 0],
|
||||
@@ -61,7 +61,7 @@ final class PageTest extends KernelTestCase
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function generateGetLastItemNumber()
|
||||
public static function generateGetLastItemNumber()
|
||||
{
|
||||
return [
|
||||
[1, 10, 9],
|
||||
|
@@ -43,7 +43,7 @@ final class PaginatorTest extends KernelTestCase
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function generateHasNextPage()
|
||||
public static function generateHasNextPage()
|
||||
{
|
||||
return [
|
||||
[10, 10, 1, false],
|
||||
@@ -53,7 +53,7 @@ final class PaginatorTest extends KernelTestCase
|
||||
];
|
||||
}
|
||||
|
||||
public function generateHasPage()
|
||||
public static function generateHasPage()
|
||||
{
|
||||
return [
|
||||
[10, 10, -1, false],
|
||||
@@ -72,7 +72,7 @@ final class PaginatorTest extends KernelTestCase
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function generateHasPreviousPage()
|
||||
public static function generateHasPreviousPage()
|
||||
{
|
||||
return [
|
||||
[10, 10, 1, false],
|
||||
@@ -88,7 +88,7 @@ final class PaginatorTest extends KernelTestCase
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function generatePageNumber()
|
||||
public static function generatePageNumber()
|
||||
{
|
||||
return [
|
||||
[12, 10, 2],
|
||||
|
@@ -25,7 +25,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
*/
|
||||
final class PhonenumberHelperTest extends KernelTestCase
|
||||
{
|
||||
public function formatPhonenumbers()
|
||||
public static function formatPhonenumbers()
|
||||
{
|
||||
yield [
|
||||
'BE',
|
||||
|
@@ -21,7 +21,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
final class ExtractDateFromPatternTest extends TestCase
|
||||
{
|
||||
public function provideSubjects()
|
||||
public static function provideSubjects()
|
||||
{
|
||||
yield ['15/06/1981', '', 1, '1981-06-15'];
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
*/
|
||||
final class ExtractPhonenumberFromPatternTest extends KernelTestCase
|
||||
{
|
||||
public function provideData()
|
||||
public static function provideData()
|
||||
{
|
||||
yield ['BE', 'Diallo', 0, [], 'Diallo', 'no phonenumber'];
|
||||
|
||||
|
@@ -32,7 +32,7 @@ final class DateNormalizerTest extends KernelTestCase
|
||||
$this->prophet = new Prophet();
|
||||
}
|
||||
|
||||
public function generateDataNormalize()
|
||||
public static function generateDataNormalize()
|
||||
{
|
||||
$datetime = \DateTime::createFromFormat('Y-m-d H:i:sO', '2021-06-05 15:05:01+02:00');
|
||||
$date = \DateTime::createFromFormat('Y-m-d H:i:sO', '2021-06-05 00:00:00+02:00');
|
||||
|
@@ -35,7 +35,7 @@ final class DoctrineExistingEntityNormalizerTest extends KernelTestCase
|
||||
$this->normalizer = new DoctrineExistingEntityNormalizer($em, $serializerFactory);
|
||||
}
|
||||
|
||||
public function dataProviderUserId()
|
||||
public static function dataProviderUserId()
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -28,7 +28,7 @@ final class PhonenumberNormalizerTest extends TestCase
|
||||
{
|
||||
use ProphecyTrait;
|
||||
|
||||
public function dataProviderNormalizePhonenumber()
|
||||
public static function dataProviderNormalizePhonenumber()
|
||||
{
|
||||
$phonenumberUtil = PhoneNumberUtil::getInstance();
|
||||
|
||||
|
@@ -40,7 +40,7 @@ final class UserNormalizerTest extends TestCase
|
||||
/**
|
||||
* @throws NumberParseException
|
||||
*/
|
||||
public function dataProviderUserNormalizer()
|
||||
public static function dataProviderUserNormalizer()
|
||||
{
|
||||
$user = new User();
|
||||
$userNoPhone = new User();
|
||||
|
@@ -29,7 +29,7 @@ final class RollingDateConverterTest extends TestCase
|
||||
$this->converter = new RollingDateConverter();
|
||||
}
|
||||
|
||||
public function generateDataConversionDate(): iterable
|
||||
public static function generateDataConversionDate(): iterable
|
||||
{
|
||||
$format = 'Y-m-d His';
|
||||
|
||||
|
@@ -30,7 +30,7 @@ final class AddressRenderTest extends KernelTestCase
|
||||
self::bootKernel();
|
||||
}
|
||||
|
||||
public function addressDataProviderBEWithBuilding(): \Iterator
|
||||
public static function addressDataProviderBEWithBuilding(): \Iterator
|
||||
{
|
||||
$addr = new Address();
|
||||
$country = (new Country())
|
||||
@@ -50,7 +50,7 @@ final class AddressRenderTest extends KernelTestCase
|
||||
yield [$addr, 'Résidence "Les Bleuets" — Rue ABC, 5 — 012345 Locality — Belgium'];
|
||||
}
|
||||
|
||||
public function addressDataProviderBEWithSteps(): \Iterator
|
||||
public static function addressDataProviderBEWithSteps(): \Iterator
|
||||
{
|
||||
$addr = new Address();
|
||||
$country = (new Country())
|
||||
@@ -70,7 +70,7 @@ final class AddressRenderTest extends KernelTestCase
|
||||
yield [$addr, 'esc 4 — Rue ABC, 5 — 012345 Locality — Belgium'];
|
||||
}
|
||||
|
||||
public function addressDataProviderFRWithBuilding(): \Iterator
|
||||
public static function addressDataProviderFRWithBuilding(): \Iterator
|
||||
{
|
||||
$addr = new Address();
|
||||
$country = (new Country())
|
||||
@@ -90,7 +90,7 @@ final class AddressRenderTest extends KernelTestCase
|
||||
yield [$addr, 'Résidence "Les Bleuets" — 5, Rue ABC — 012345 Locality — France'];
|
||||
}
|
||||
|
||||
public function addressDataProviderFRWithSteps(): \Iterator
|
||||
public static function addressDataProviderFRWithSteps(): \Iterator
|
||||
{
|
||||
$addr = new Address();
|
||||
$country = (new Country())
|
||||
@@ -110,7 +110,7 @@ final class AddressRenderTest extends KernelTestCase
|
||||
yield [$addr, 'esc 4 — 5, Rue ABC — 012345 Locality — France'];
|
||||
}
|
||||
|
||||
public function complexAddressDataProviderBE(): \Iterator
|
||||
public static function complexAddressDataProviderBE(): \Iterator
|
||||
{
|
||||
$addr = new Address();
|
||||
$country = (new Country())
|
||||
@@ -134,7 +134,7 @@ final class AddressRenderTest extends KernelTestCase
|
||||
yield [$addr, 'Résidence "Les Bleuets" - appart 1 - ét 2 - coul 3 - esc 4 — Rue ABC, 5 — 012345 Locality — Belgium'];
|
||||
}
|
||||
|
||||
public function complexAddressDataProviderFR(): \Iterator
|
||||
public static function complexAddressDataProviderFR(): \Iterator
|
||||
{
|
||||
$addr = new Address();
|
||||
$country = (new Country())
|
||||
@@ -160,7 +160,7 @@ final class AddressRenderTest extends KernelTestCase
|
||||
yield [$addr, 'appart 1 - ét 2 - coul 3 - esc 4 — Résidence "Les Bleuets" — 5, Rue ABC — A droite de la porte — 012345 Locality CEDEX — France'];
|
||||
}
|
||||
|
||||
public function noFullAddressDataProviderBE(): \Iterator
|
||||
public static function noFullAddressDataProviderBE(): \Iterator
|
||||
{
|
||||
$addr = new Address();
|
||||
$country = (new Country())
|
||||
@@ -177,7 +177,7 @@ final class AddressRenderTest extends KernelTestCase
|
||||
yield [$addr, '012345 Locality — Belgium'];
|
||||
}
|
||||
|
||||
public function simpleAddressDataProviderBE(): \Iterator
|
||||
public static function simpleAddressDataProviderBE(): \Iterator
|
||||
{
|
||||
$addr = new Address();
|
||||
$country = (new Country())
|
||||
@@ -195,7 +195,7 @@ final class AddressRenderTest extends KernelTestCase
|
||||
yield [$addr, 'Rue ABC, 5 — 012345 Locality — Belgium'];
|
||||
}
|
||||
|
||||
public function simpleAddressDataProviderFR(): \Iterator
|
||||
public static function simpleAddressDataProviderFR(): \Iterator
|
||||
{
|
||||
$addr = new Address();
|
||||
$country = (new Country())
|
||||
|
Reference in New Issue
Block a user