Skip to content

Commit

Permalink
Check if the identifier is an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Sep 29, 2023
1 parent 6ff58fe commit 86c18bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 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,11 +768,14 @@ 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
}
}
if (empty($identifier)) {
echo var_export($test, true);
}

$dataTest = [
'suite_id' => $suiteId,
Expand Down

0 comments on commit 86c18bc

Please # to comment.