mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 22:35:01 +00:00
Merge branch 'master' into upgrade-sf5
This commit is contained in:
@@ -84,7 +84,7 @@ final class DateNormalizerTest extends KernelTestCase
|
||||
$this->assertFalse($this->buildDateNormalizer()->supportsNormalization(new \DateTime(), 'xml'));
|
||||
}
|
||||
|
||||
private function buildDateNormalizer(string $locale = null): DateNormalizer
|
||||
private function buildDateNormalizer(?string $locale = null): DateNormalizer
|
||||
{
|
||||
$requestStack = $this->prophet->prophesize(RequestStack::class);
|
||||
$parameterBag = new ParameterBag();
|
||||
|
@@ -40,7 +40,7 @@ final class PhonenumberNormalizerTest extends TestCase
|
||||
/**
|
||||
* @dataProvider dataProviderNormalizePhonenumber
|
||||
*/
|
||||
public function testNormalize(?Phonenumber $phonenumber, mixed $format, mixed $context, mixed $expected)
|
||||
public function testNormalize(?PhoneNumber $phonenumber, mixed $format, mixed $context, mixed $expected)
|
||||
{
|
||||
$parameterBag = $this->prophesize(ParameterBagInterface::class);
|
||||
$parameterBag->get(Argument::exact('chill_main'))->willReturn(['phone_helper' => ['default_carrier_code' => 'BE']]);
|
||||
|
@@ -117,19 +117,19 @@ final class UserNormalizerTest extends TestCase
|
||||
*
|
||||
* @throws ExceptionInterface
|
||||
*/
|
||||
public function testNormalize(null|User $user, mixed $format, mixed $context, mixed $expected)
|
||||
public function testNormalize(User|null $user, mixed $format, mixed $context, mixed $expected)
|
||||
{
|
||||
$userRender = $this->prophesize(UserRender::class);
|
||||
$userRender->renderString(Argument::type(User::class), Argument::type('array'))->willReturn($user ? $user->getLabel() : '');
|
||||
|
||||
$normalizer = new UserNormalizer($userRender->reveal());
|
||||
$normalizer->setNormalizer(new class () implements NormalizerInterface {
|
||||
public function normalize($object, string $format = null, array $context = [])
|
||||
public function normalize($object, ?string $format = null, array $context = [])
|
||||
{
|
||||
return ['context' => $context['docgen:expects'] ?? null];
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, string $format = null)
|
||||
public function supportsNormalization($data, ?string $format = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user