mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Ensure loading of postal code does not fails
This commit is contained in:
parent
009a0326d9
commit
f68a163a30
@ -45,10 +45,6 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
|||||||
|
|
||||||
public function load(ObjectManager $manager): void
|
public function load(ObjectManager $manager): void
|
||||||
{
|
{
|
||||||
$arr = range(-50, 50);
|
|
||||||
|
|
||||||
echo "Creating calendar range ('plage de disponibilités')\n";
|
|
||||||
|
|
||||||
$users = $this->userRepository->findAll();
|
$users = $this->userRepository->findAll();
|
||||||
|
|
||||||
$location = (new Location())
|
$location = (new Location())
|
||||||
@ -69,6 +65,8 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
|||||||
$manager->persist($type);
|
$manager->persist($type);
|
||||||
$manager->persist($location);
|
$manager->persist($location);
|
||||||
|
|
||||||
|
$now = new DateTimeImmutable();
|
||||||
|
|
||||||
$days = [
|
$days = [
|
||||||
'2021-08-23',
|
'2021-08-23',
|
||||||
'2021-08-24',
|
'2021-08-24',
|
||||||
@ -80,6 +78,10 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
|||||||
'2021-09-02',
|
'2021-09-02',
|
||||||
(new DateTimeImmutable('tomorrow'))->format('Y-m-d'),
|
(new DateTimeImmutable('tomorrow'))->format('Y-m-d'),
|
||||||
(new DateTimeImmutable('today'))->format('Y-m-d'),
|
(new DateTimeImmutable('today'))->format('Y-m-d'),
|
||||||
|
$now->add(new \DateInterval('P7D'))->format('Y-m-d'),
|
||||||
|
$now->add(new \DateInterval('P8D'))->format('Y-m-d'),
|
||||||
|
$now->add(new \DateInterval('P9D'))->format('Y-m-d'),
|
||||||
|
$now->add(new \DateInterval('P10D'))->format('Y-m-d'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$hours = [
|
$hours = [
|
||||||
|
@ -357,11 +357,11 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
$c->setRefPostalCodeId($code[3]);
|
$c->setRefPostalCodeId($code[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $code[4] & null !== $code[5]) {
|
if (null !== ($code[4] ?? null) & null !== ($code[5] ?? null)) {
|
||||||
$c->setCenter(Point::fromLonLat((float) $code[5], (float) $code[4]));
|
$c->setCenter(Point::fromLonLat((float) $code[5], (float) $code[4]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $code[6]) {
|
if (null !== ($code[6] ?? null)) {
|
||||||
$c->setPostalCodeSource($code[6]);
|
$c->setPostalCodeSource($code[6]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
tests/app/config/packages/dev/messenger.yaml
Normal file
4
tests/app/config/packages/dev/messenger.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
framework:
|
||||||
|
messenger:
|
||||||
|
transports:
|
||||||
|
async: 'in-memory://'
|
15
tests/app/config/packages/messenger.yaml
Normal file
15
tests/app/config/packages/messenger.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
framework:
|
||||||
|
messenger:
|
||||||
|
# Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
|
||||||
|
# failure_transport: failed
|
||||||
|
|
||||||
|
transports:
|
||||||
|
# https://symfony.com/doc/current/messenger.html#transport-configuration
|
||||||
|
# async: '%env(MESSENGER_TRANSPORT_DSN)%'
|
||||||
|
# failed: 'doctrine://default?queue_name=failed'
|
||||||
|
# sync: 'sync://'
|
||||||
|
|
||||||
|
routing:
|
||||||
|
# Route your messages to the transports
|
||||||
|
'Chill\CalendarBundle\Messenger\Message\CalendarRangeMessage': async
|
||||||
|
# 'App\Message\YourMessage': async
|
6
tests/app/config/packages/test/messenger.yaml
Normal file
6
tests/app/config/packages/test/messenger.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
framework:
|
||||||
|
messenger:
|
||||||
|
transports:
|
||||||
|
async: 'in-memory://'
|
||||||
|
failed: 'in-memory://'
|
||||||
|
sync: 'in-memory://'
|
Loading…
x
Reference in New Issue
Block a user