Skip to content

Commit

Permalink
Merge pull request #345 from PrestaShop/fixUnitTests
Browse files Browse the repository at this point in the history
Fixed Unit Tests
  • Loading branch information
Progi1984 authored Jan 29, 2025
2 parents fb40dd0 + 2cf41fb commit f5ca3b6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/Controller/ReportControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ class ReportControllerTest extends WebTestCase

public static function setUpBeforeClass(): void
{
$data = file_get_contents('https://api-nightly.prestashop-project.org/reports?filter_version=develop&filter_campaign=functional');
$data = json_decode($data, true);
foreach ($data as $datum) {
if ($datum['date'] === self::DATE_RESOURCE) {
self::$reportId = $datum['id'];
break;
$numPage = 1;
do {
$data = file_get_contents('https://api-nightly.prestashop-project.org/reports?filter_version=develop&filter_campaign=functional&limit=100&page=' . $numPage);
$data = json_decode($data, true);
foreach ($data['reports'] as $datum) {
if ($datum['date'] === self::DATE_RESOURCE) {
self::$reportId = $datum['id'];
break;
}
}
}
++$numPage;
} while (self::$reportId == 0);

$data = file_get_contents('https://api-nightly.prestashop-project.org/reports/' . self::$reportId);
$data = json_decode($data, true);
Expand Down

0 comments on commit f5ca3b6

Please sign in to comment.