Skip to content

Commit

Permalink
Merge pull request #76 from PrestaShop/fixIntegrityMocha
Browse files Browse the repository at this point in the history
Check if the identifier is an array
  • Loading branch information
Progi1984 authored Nov 8, 2023
2 parents 6ff58fe + 58ea570 commit a0e9d49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ private function loopThrough(int $executionId, stdClass $suite, ?int $parentSuit
if (isset($test->context)) {
try {
$identifier_data = json_decode($test->context);
$identifier = $identifier_data->value;
$identifier = is_array($identifier_data) ? $identifier_data[0]->value : $identifier_data->value;
} catch (Exception $e) {
}
}
Expand Down Expand Up @@ -768,7 +768,7 @@ private function loopThroughSuite(int $executionId, stdClass $suite, ?int $paren
if (isset($test->context)) {
try {
$identifier_data = json_decode($test->context);
$identifier = $identifier_data->value;
$identifier = is_array($identifier_data) ? $identifier_data[0]->value : $identifier_data->value;
} catch (Exception $e) {
// Don't care if it fails
}
Expand Down

0 comments on commit a0e9d49

Please # to comment.