From 246756b1cb2746c0fe99f7588db22c16c46cfa3c Mon Sep 17 00:00:00 2001 From: florimondmanca Date: Wed, 8 Jan 2025 14:33:39 +0100 Subject: [PATCH] Ajoute une option pour afficher des infos de debug dans le rapport Litteralis --- .../IntegrationReport/CommonRecordEnum.php | 1 + .../IntegrationReport/ReportFormatter.php | 14 +++++- .../Litteralis/Fougeres/FougeresExecutor.php | 4 +- .../Litteralis/LitteralisExecutor.php | 14 ++++-- .../Litteralis/LitteralisExtractor.php | 10 +++- .../Litteralis/LitteralisPeriodParser.php | 22 +++++--- .../Litteralis/LitteralisTransformer.php | 28 +++++++---- .../Litteralis/MEL/MELExecutor.php | 4 +- .../Symfony/Command/FougeresImportCommand.php | 9 +++- .../Symfony/Command/MELImportCommand.php | 9 +++- .../Symfony/Option/Litteralis/DebugOption.php | 21 ++++++++ .../Litteralis/LitteralisExecutorTest.php | 4 +- .../Litteralis/LitteralisExtractorTest.php | 4 +- .../Litteralis/LitteralisPeriodParserTest.php | 13 ++++- .../Litteralis/LitteralisTransformerTest.php | 50 ++++++++++++------- 15 files changed, 154 insertions(+), 53 deletions(-) create mode 100644 src/Infrastructure/Symfony/Option/Litteralis/DebugOption.php diff --git a/src/Infrastructure/IntegrationReport/CommonRecordEnum.php b/src/Infrastructure/IntegrationReport/CommonRecordEnum.php index 35495880c..3a56e172c 100644 --- a/src/Infrastructure/IntegrationReport/CommonRecordEnum.php +++ b/src/Infrastructure/IntegrationReport/CommonRecordEnum.php @@ -8,6 +8,7 @@ enum CommonRecordEnum: string { case ATTR_REGULATION_ID = 'regulationId'; case ATTR_URL = 'url'; + case ATTR_DEBUG = 'debug'; case FACT_INTEGRATION_NAME = 'common.integration_name'; case FACT_ORGANIZATION = 'common.organization'; diff --git a/src/Infrastructure/IntegrationReport/ReportFormatter.php b/src/Infrastructure/IntegrationReport/ReportFormatter.php index b3f3d02bf..0fe299e0f 100644 --- a/src/Infrastructure/IntegrationReport/ReportFormatter.php +++ b/src/Infrastructure/IntegrationReport/ReportFormatter.php @@ -51,7 +51,7 @@ private function arrayEncode(array $array): string return implode(' ; ', $items); } - public function format(array $records): string + public function format(array $records, bool $isDebugEnabled = false): string { $lines = []; @@ -138,12 +138,17 @@ public function format(array $records): string if (!\in_array($regulationId, $info['regulations'])) { $info['regulations'][] = $regulationId; + $info['debug'][$regulationId] = []; if (\array_key_exists(CommonRecordEnum::ATTR_URL->value, $context)) { $info['urls'][$regulationId] = $context[CommonRecordEnum::ATTR_URL->value]; } } + if (\array_key_exists(CommonRecordEnum::ATTR_DEBUG->value, $context)) { + $info['debug'][$regulationId][] = $context[CommonRecordEnum::ATTR_DEBUG->value]; + } + $caseLists[$type][$name] = $info; } @@ -173,11 +178,16 @@ public function format(array $records): string foreach ($info['regulations'] as $id) { $line = \sprintf(' %s', $id); - if (\array_key_exists($id, $info['urls'])) { + if (!empty($info['urls']) && \array_key_exists($id, $info['urls'])) { $url = $info['urls'][$id]; $line = \sprintf('%s (%s)', $line, $url); } + if ($isDebugEnabled && \array_key_exists($id, $info['debug']) && !empty($info['debug'][$id])) { + $debugItems = $info['debug'][$id]; + $line = \sprintf('%s (debug: %s)', $line, json_encode($debugItems)); + } + $lines[] = $line; } diff --git a/src/Infrastructure/Litteralis/Fougeres/FougeresExecutor.php b/src/Infrastructure/Litteralis/Fougeres/FougeresExecutor.php index ffea2e3d9..d2110870c 100644 --- a/src/Infrastructure/Litteralis/Fougeres/FougeresExecutor.php +++ b/src/Infrastructure/Litteralis/Fougeres/FougeresExecutor.php @@ -19,8 +19,8 @@ public function __construct( $this->executor->configure($fougeresCredentials); } - public function execute(\DateTimeInterface $laterThan, Reporter $reporter): string + public function execute(\DateTimeInterface $laterThan, Reporter $reporter, bool $isDebugEnabled = false): string { - return $this->executor->execute(self::INTEGRATION_NAME, $this->fougeresOrgId, $laterThan, $reporter); + return $this->executor->execute(self::INTEGRATION_NAME, $this->fougeresOrgId, $laterThan, $reporter, $isDebugEnabled); } } diff --git a/src/Infrastructure/Litteralis/LitteralisExecutor.php b/src/Infrastructure/Litteralis/LitteralisExecutor.php index f5bde0479..ec8cad868 100644 --- a/src/Infrastructure/Litteralis/LitteralisExecutor.php +++ b/src/Infrastructure/Litteralis/LitteralisExecutor.php @@ -33,7 +33,7 @@ public function configure(string $credentials): void $this->extractor->configure($credentials); } - public function execute(string $name, string $orgId, \DateTimeInterface $laterThan, Reporter $reporter): string + public function execute(string $name, string $orgId, \DateTimeInterface $laterThan, Reporter $reporter, bool $isDebugEnabled = false): string { try { /** @var Organization */ @@ -69,7 +69,9 @@ public function execute(string $name, string $orgId, \DateTimeInterface $laterTh $reporter->addError(LitteralisRecordEnum::ERROR_IMPORT_COMMAND_FAILED->value, [ CommonRecordEnum::ATTR_REGULATION_ID->value => $regulationFeatures[0]['properties']['arretesrcid'], CommonRecordEnum::ATTR_URL->value => $regulationFeatures[0]['properties']['shorturl'], - 'message' => $exc->getMessage(), + CommonRecordEnum::ATTR_DEBUG->value => [ + 'message' => $exc->getMessage(), + ], 'violations' => $exc instanceof ValidationFailedException ? iterator_to_array($exc->getViolations()) : null, 'command' => $command, ]); @@ -78,10 +80,14 @@ public function execute(string $name, string $orgId, \DateTimeInterface $laterTh $reporter->acknowledgeNewErrors(); } - $reporter->addCount(LitteralisRecordEnum::COUNT_IMPORTED_FEATURES->value, $numImportedFeatures, ['regulationsCount' => $numImportedRegulations]); + $reporter->addCount(LitteralisRecordEnum::COUNT_IMPORTED_FEATURES->value, $numImportedFeatures, [ + CommonRecordEnum::ATTR_DEBUG->value => [ + 'regulationsCount' => $numImportedRegulations, + ], + ]); $reporter->end(endTime: $this->dateUtils->getNow()); - $report = $this->reportFormatter->format($reporter->getRecords()); + $report = $this->reportFormatter->format($reporter->getRecords(), $isDebugEnabled); $reporter->onReport($report); return $report; diff --git a/src/Infrastructure/Litteralis/LitteralisExtractor.php b/src/Infrastructure/Litteralis/LitteralisExtractor.php index 27c13824e..20c1d8666 100644 --- a/src/Infrastructure/Litteralis/LitteralisExtractor.php +++ b/src/Infrastructure/Litteralis/LitteralisExtractor.php @@ -47,7 +47,9 @@ public function extractFeaturesByRegulation(\DateTimeInterface $laterThan, Repor $reporter->addWarning(LitteralisRecordEnum::WARNING_MISSING_GEOMETRY->value, [ CommonRecordEnum::ATTR_REGULATION_ID->value => $identifier, CommonRecordEnum::ATTR_URL->value => $feature['properties']['shorturl'], - 'idemprise' => $feature['properties']['idemprise'], + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => $feature['properties']['idemprise'], + ], ]); continue; } @@ -67,7 +69,11 @@ public function extractFeaturesByRegulation(\DateTimeInterface $laterThan, Repor ++$numExtractedFeatures; } - $reporter->addCount(LitteralisRecordEnum::COUNT_EXTRACTED_FEATURES->value, $numExtractedFeatures, ['regulationsCount' => \count($featuresByRegulation)]); + $reporter->addCount(LitteralisRecordEnum::COUNT_EXTRACTED_FEATURES->value, $numExtractedFeatures, [ + CommonRecordEnum::ATTR_DEBUG->value => [ + 'regulationsCount' => \count($featuresByRegulation), + ], + ]); $reporter->onExtract(json_encode($featuresByRegulation, JSON_UNESCAPED_UNICODE & JSON_UNESCAPED_SLASHES)); return $featuresByRegulation; diff --git a/src/Infrastructure/Litteralis/LitteralisPeriodParser.php b/src/Infrastructure/Litteralis/LitteralisPeriodParser.php index 85470dda0..3a9998222 100644 --- a/src/Infrastructure/Litteralis/LitteralisPeriodParser.php +++ b/src/Infrastructure/Litteralis/LitteralisPeriodParser.php @@ -55,9 +55,11 @@ private function setPeriodDates(SavePeriodCommand $periodCommand, array $propert [ CommonRecordEnum::ATTR_REGULATION_ID->value => $properties['arretesrcid'], CommonRecordEnum::ATTR_URL->value => $properties['shorturl'], - 'idemprise' => $properties['idemprise'], - $startDateProperty => $properties[$startDateProperty], - 'format' => $dateFormat, + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => $properties['idemprise'], + $startDateProperty => $properties[$startDateProperty], + 'format' => $dateFormat, + ], ], ); } @@ -82,9 +84,11 @@ private function setPeriodDates(SavePeriodCommand $periodCommand, array $propert [ CommonRecordEnum::ATTR_REGULATION_ID->value => $properties['arretesrcid'], CommonRecordEnum::ATTR_URL->value => $properties['shorturl'], - 'idemprise' => $properties['idemprise'], - $endDateProperty => $properties[$endDateProperty], - 'format' => $dateFormat, + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => $properties['idemprise'], + $endDateProperty => $properties[$endDateProperty], + 'format' => $dateFormat, + ], ], ); } @@ -168,8 +172,10 @@ public function parseTimeSlots(string $value, array $properties, Reporter $repor $reporter->addError(LitteralisRecordEnum::ERROR_PERIOD_UNPARSABLE->value, [ CommonRecordEnum::ATTR_REGULATION_ID->value => $properties['arretesrcid'], CommonRecordEnum::ATTR_URL->value => $properties['shorturl'], - 'idemprise' => $properties['idemprise'], - 'jours et horaires' => $value, + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => $properties['idemprise'], + 'jours et horaires' => $value, + ], ]); return []; diff --git a/src/Infrastructure/Litteralis/LitteralisTransformer.php b/src/Infrastructure/Litteralis/LitteralisTransformer.php index e27aca58f..f50292b44 100644 --- a/src/Infrastructure/Litteralis/LitteralisTransformer.php +++ b/src/Infrastructure/Litteralis/LitteralisTransformer.php @@ -234,8 +234,10 @@ private function gatherMeasureParameters(array $properties, Reporter $reporter): if (!\array_key_exists($name, self::MEASURE_MAP)) { $reporter->addNotice(LitteralisRecordEnum::NOTICE_UNSUPPORTED_MEASURE->value, [ CommonRecordEnum::ATTR_REGULATION_ID->value => $properties['arretesrcid'], - 'name' => $name, - 'idemprise' => $properties['idemprise'], + CommonRecordEnum::ATTR_DEBUG->value => [ + 'name' => $name, + 'idemprise' => $properties['idemprise'], + ], ]); continue; } @@ -294,10 +296,12 @@ private function gatherMeasureParameters(array $properties, Reporter $reporter): $reporter->addError(LitteralisRecordEnum::ERROR_MEASURE_PARAMETER_INCONSISTENT_NUMBER->value, [ CommonRecordEnum::ATTR_REGULATION_ID->value => $properties['arretesrcid'], CommonRecordEnum::ATTR_URL->value => $properties['shorturl'], - 'idemprise' => $properties['idemprise'], - 'measureName' => $name, - 'expected' => $index + 1, - 'actual' => $number, + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => $properties['idemprise'], + 'measureName' => $name, + 'expected' => $index + 1, + 'actual' => $number, + ], ]); continue; @@ -393,8 +397,10 @@ private function parseMaxSpeed(array $properties, array $parameters, Reporter $r $reporter->addError(LitteralisRecordEnum::ERROR_MAX_SPEED_VALUE_MISSING->value, [ CommonRecordEnum::ATTR_REGULATION_ID->value => $properties['arretesrcid'], CommonRecordEnum::ATTR_URL->value => $properties['shorturl'], - 'idemprise' => $properties['idemprise'], - 'mesures' => $properties['mesures'], + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => $properties['idemprise'], + 'mesures' => $properties['mesures'], + ], ]); return null; @@ -404,8 +410,10 @@ private function parseMaxSpeed(array $properties, array $parameters, Reporter $r $reporter->addError(LitteralisRecordEnum::ERROR_MAX_SPEED_VALUE_INVALID->value, [ CommonRecordEnum::ATTR_REGULATION_ID->value => $properties['arretesrcid'], CommonRecordEnum::ATTR_URL->value => $properties['shorturl'], - 'idemprise' => $properties['idemprise'], - 'limite de vitesse' => $value, + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => $properties['idemprise'], + 'limite de vitesse' => $value, + ], ]); return null; diff --git a/src/Infrastructure/Litteralis/MEL/MELExecutor.php b/src/Infrastructure/Litteralis/MEL/MELExecutor.php index c486b8991..2e14fce3e 100644 --- a/src/Infrastructure/Litteralis/MEL/MELExecutor.php +++ b/src/Infrastructure/Litteralis/MEL/MELExecutor.php @@ -19,8 +19,8 @@ public function __construct( $this->executor->configure($melCredentials); } - public function execute(\DateTimeInterface $laterThan, Reporter $reporter): string + public function execute(\DateTimeInterface $laterThan, Reporter $reporter, bool $isDebugEnabled = false): string { - return $this->executor->execute(self::INTEGRATION_NAME, $this->melOrgId, $laterThan, $reporter); + return $this->executor->execute(self::INTEGRATION_NAME, $this->melOrgId, $laterThan, $reporter, $isDebugEnabled); } } diff --git a/src/Infrastructure/Symfony/Command/FougeresImportCommand.php b/src/Infrastructure/Symfony/Command/FougeresImportCommand.php index 534f9492d..ced55baf7 100644 --- a/src/Infrastructure/Symfony/Command/FougeresImportCommand.php +++ b/src/Infrastructure/Symfony/Command/FougeresImportCommand.php @@ -7,6 +7,7 @@ use App\Application\DateUtilsInterface; use App\Infrastructure\IntegrationReport\Reporter; use App\Infrastructure\Litteralis\Fougeres\FougeresExecutor; +use App\Infrastructure\Symfony\Option\Litteralis\DebugOption; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -28,13 +29,19 @@ public function __construct( parent::__construct(); } + protected function configure(): void + { + DebugOption::configureCommand($this); + } + public function execute(InputInterface $input, OutputInterface $output): int { $reporter = new Reporter($this->logger); $now = $this->dateUtils->getNow(); + $isDebugEnabled = DebugOption::getFromInput($input); try { - $report = $this->executor->execute($now, $reporter); + $report = $this->executor->execute($now, $reporter, $isDebugEnabled); $output->write($report); } catch (\RuntimeException $exc) { diff --git a/src/Infrastructure/Symfony/Command/MELImportCommand.php b/src/Infrastructure/Symfony/Command/MELImportCommand.php index 00c80a761..155973bc4 100644 --- a/src/Infrastructure/Symfony/Command/MELImportCommand.php +++ b/src/Infrastructure/Symfony/Command/MELImportCommand.php @@ -7,6 +7,7 @@ use App\Application\DateUtilsInterface; use App\Infrastructure\IntegrationReport\Reporter; use App\Infrastructure\Litteralis\MEL\MELExecutor; +use App\Infrastructure\Symfony\Option\Litteralis\DebugOption; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -28,13 +29,19 @@ public function __construct( parent::__construct(); } + protected function configure(): void + { + DebugOption::configureCommand($this); + } + public function execute(InputInterface $input, OutputInterface $output): int { $reporter = new Reporter($this->logger); $now = $this->dateUtils->getNow(); + $isDebugEnabled = DebugOption::getFromInput($input); try { - $report = $this->executor->execute(laterThan: $now, reporter: $reporter); + $report = $this->executor->execute($now, $reporter, $isDebugEnabled); $output->write($report); } catch (\RuntimeException $exc) { diff --git a/src/Infrastructure/Symfony/Option/Litteralis/DebugOption.php b/src/Infrastructure/Symfony/Option/Litteralis/DebugOption.php new file mode 100644 index 000000000..cc314a04f --- /dev/null +++ b/src/Infrastructure/Symfony/Option/Litteralis/DebugOption.php @@ -0,0 +1,21 @@ +addOption('debug', description: 'Include debug information in report'); + } + + public static function getFromInput(InputInterface $input): bool + { + return $input->getOption('debug'); + } +} diff --git a/tests/Unit/Infrastructure/Litteralis/LitteralisExecutorTest.php b/tests/Unit/Infrastructure/Litteralis/LitteralisExecutorTest.php index 717a23557..18e9eb7d0 100644 --- a/tests/Unit/Infrastructure/Litteralis/LitteralisExecutorTest.php +++ b/tests/Unit/Infrastructure/Litteralis/LitteralisExecutorTest.php @@ -170,9 +170,11 @@ public function testExecute(): void ->expects(self::once()) ->method('addError') ->with(LitteralisRecordEnum::ERROR_IMPORT_COMMAND_FAILED->value, [ - 'message' => 'oops', CommonRecordEnum::ATTR_REGULATION_ID->value => '1234', CommonRecordEnum::ATTR_URL->value => 'https://dl.sogelink.fr/?n3omzTyS', + CommonRecordEnum::ATTR_DEBUG->value => [ + 'message' => 'oops', + ], 'violations' => null, 'command' => $command3, ]); diff --git a/tests/Unit/Infrastructure/Litteralis/LitteralisExtractorTest.php b/tests/Unit/Infrastructure/Litteralis/LitteralisExtractorTest.php index f14053be5..8019c482d 100644 --- a/tests/Unit/Infrastructure/Litteralis/LitteralisExtractorTest.php +++ b/tests/Unit/Infrastructure/Litteralis/LitteralisExtractorTest.php @@ -95,9 +95,11 @@ public function testExtractFeaturesByRegulation(): void ->expects(self::once()) ->method('addWarning') ->with(LitteralisRecordEnum::WARNING_MISSING_GEOMETRY->value, [ - 'idemprise' => 'emprise4', CommonRecordEnum::ATTR_REGULATION_ID->value => 'arrete3', CommonRecordEnum::ATTR_URL->value => 'https://dl.sogelink.fr/?n3omzTyS', + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => 'emprise4', + ], ]); $extractor = new LitteralisExtractor($this->client); diff --git a/tests/Unit/Infrastructure/Litteralis/LitteralisPeriodParserTest.php b/tests/Unit/Infrastructure/Litteralis/LitteralisPeriodParserTest.php index a1cb45464..c164e775a 100644 --- a/tests/Unit/Infrastructure/Litteralis/LitteralisPeriodParserTest.php +++ b/tests/Unit/Infrastructure/Litteralis/LitteralisPeriodParserTest.php @@ -7,6 +7,7 @@ use App\Application\Regulation\Command\Period\SavePeriodCommand; use App\Application\Regulation\Command\Period\SaveTimeSlotCommand; use App\Domain\Condition\Period\Enum\PeriodRecurrenceTypeEnum; +use App\Infrastructure\IntegrationReport\CommonRecordEnum; use App\Infrastructure\IntegrationReport\Reporter; use App\Infrastructure\Litteralis\LitteralisPeriodParser; use App\Infrastructure\Litteralis\LitteralisRecordEnum; @@ -104,7 +105,17 @@ public function testUnparsable(string $value): void $reporter ->expects(self::once()) ->method('addError') - ->with(LitteralisRecordEnum::ERROR_PERIOD_UNPARSABLE->value); + ->with( + LitteralisRecordEnum::ERROR_PERIOD_UNPARSABLE->value, + [ + CommonRecordEnum::ATTR_REGULATION_ID->value => 'id2', + CommonRecordEnum::ATTR_URL->value => 'url', + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => 'id1', + 'jours et horaires' => $value, + ], + ], + ); $this->assertEquals([], $this->parser->parseTimeSlots($value, $properties, $reporter)); } diff --git a/tests/Unit/Infrastructure/Litteralis/LitteralisTransformerTest.php b/tests/Unit/Infrastructure/Litteralis/LitteralisTransformerTest.php index e8edb5296..5338ac437 100644 --- a/tests/Unit/Infrastructure/Litteralis/LitteralisTransformerTest.php +++ b/tests/Unit/Infrastructure/Litteralis/LitteralisTransformerTest.php @@ -287,9 +287,11 @@ public function testTransformWithErrors(): void RecordTypeEnum::ERROR->value => LitteralisRecordEnum::ERROR_DATE_PARSING_FAILED->value, CommonRecordEnum::ATTR_REGULATION_ID->value => '24-A-0126', CommonRecordEnum::ATTR_URL->value => 'https://dl.sogelink.fr/?n3omzTyS', - 'arretedebut' => 'BAD FORMAT', - 'idemprise' => 493136, - 'format' => \DateTimeInterface::ISO8601, + CommonRecordEnum::ATTR_DEBUG->value => [ + 'arretedebut' => 'BAD FORMAT', + 'idemprise' => 493136, + 'format' => \DateTimeInterface::ISO8601, + ], ], ], [ @@ -298,9 +300,11 @@ public function testTransformWithErrors(): void RecordTypeEnum::ERROR->value => LitteralisRecordEnum::ERROR_DATE_PARSING_FAILED->value, CommonRecordEnum::ATTR_REGULATION_ID->value => '24-A-0126', CommonRecordEnum::ATTR_URL->value => 'https://dl.sogelink.fr/?n3omzTyS', - 'arretefin' => 'BAD FORMAT', - 'idemprise' => 493136, - 'format' => \DateTimeInterface::ISO8601, + CommonRecordEnum::ATTR_DEBUG->value => [ + 'arretefin' => 'BAD FORMAT', + 'idemprise' => 493136, + 'format' => \DateTimeInterface::ISO8601, + ], ], ], [ @@ -309,8 +313,10 @@ public function testTransformWithErrors(): void RecordTypeEnum::ERROR->value => LitteralisRecordEnum::ERROR_MAX_SPEED_VALUE_MISSING->value, CommonRecordEnum::ATTR_REGULATION_ID->value => '24-A-0126', CommonRecordEnum::ATTR_URL->value => 'https://dl.sogelink.fr/?n3omzTyS', - 'idemprise' => 493136, - 'mesures' => 'Limitation de vitesse', + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => 493136, + 'mesures' => 'Limitation de vitesse', + ], ], ], [ @@ -319,8 +325,10 @@ public function testTransformWithErrors(): void RecordTypeEnum::ERROR->value => LitteralisRecordEnum::ERROR_MAX_SPEED_VALUE_INVALID->value, CommonRecordEnum::ATTR_REGULATION_ID->value => '24-A-0126', CommonRecordEnum::ATTR_URL->value => 'https://dl.sogelink.fr/?n3omzTyS', - 'idemprise' => 493136, - 'limite de vitesse' => 'foo km/h', + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => 493136, + 'limite de vitesse' => 'foo km/h', + ], ], ], [ @@ -329,10 +337,12 @@ public function testTransformWithErrors(): void RecordTypeEnum::ERROR->value => LitteralisRecordEnum::ERROR_MEASURE_PARAMETER_INCONSISTENT_NUMBER->value, CommonRecordEnum::ATTR_REGULATION_ID->value => '24-A-0126', CommonRecordEnum::ATTR_URL->value => 'https://dl.sogelink.fr/?n3omzTyS', - 'idemprise' => 493136, - 'measureName' => 'Circulation interdite 4', - 'expected' => 1, - 'actual' => 4, + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => 493136, + 'measureName' => 'Circulation interdite 4', + 'expected' => 1, + 'actual' => 4, + ], ], ], [ @@ -341,8 +351,10 @@ public function testTransformWithErrors(): void RecordTypeEnum::ERROR->value => LitteralisRecordEnum::ERROR_PERIOD_UNPARSABLE->value, CommonRecordEnum::ATTR_REGULATION_ID->value => '24-A-0126', CommonRecordEnum::ATTR_URL->value => 'https://dl.sogelink.fr/?n3omzTyS', - 'idemprise' => 493136, - 'jours et horaires' => 'foo', + CommonRecordEnum::ATTR_DEBUG->value => [ + 'idemprise' => 493136, + 'jours et horaires' => 'foo', + ], ], ], ], $this->reporter->getRecords()); @@ -363,8 +375,10 @@ public function testTransformNoMeasuresFound(): void [ RecordTypeEnum::NOTICE->value => LitteralisRecordEnum::NOTICE_UNSUPPORTED_MEASURE->value, CommonRecordEnum::ATTR_REGULATION_ID->value => '24-A-0126', - 'name' => 'unknown measure', - 'idemprise' => 493136, + CommonRecordEnum::ATTR_DEBUG->value => [ + 'name' => 'unknown measure', + 'idemprise' => 493136, + ], ], ], [