From d8ff148f86fc8f3b686d82c1b0606f1e406ac162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 29 Sep 2026 14:37:59 +0200 Subject: [PATCH] fix: adopt changed export api url --- src/Command/MyEpCheckCommand.php | 2 +- src/MyEp/Import/TravelExportClient.php | 2 +- tests/MyEp/Api/ApiClientTest.php | 2 +- tests/MyEp/Import/TravelExportClientTest.php | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Command/MyEpCheckCommand.php b/src/Command/MyEpCheckCommand.php index e538919..ac88407 100644 --- a/src/Command/MyEpCheckCommand.php +++ b/src/Command/MyEpCheckCommand.php @@ -66,7 +66,7 @@ class MyEpCheckCommand extends Command // A whole page rather than one row: the first row often has no boarding points, and an // unread pickups array is exactly the failure this probe exists to catch. - $payload = $this->apiClient->get('api/travels/export', ['page' => 1, 'perPage' => 500]); + $payload = $this->apiClient->get('api/exports/travels', ['page' => 1, 'perPage' => 500]); $meta = $payload['meta'] ?? []; $io->definitionList(...array_map( diff --git a/src/MyEp/Import/TravelExportClient.php b/src/MyEp/Import/TravelExportClient.php index dbba819..a7e9e85 100644 --- a/src/MyEp/Import/TravelExportClient.php +++ b/src/MyEp/Import/TravelExportClient.php @@ -11,7 +11,7 @@ use Psr\Log\LoggerInterface; */ class TravelExportClient { - private const PATH = 'api/travels/export'; + private const PATH = 'api/exports/travels'; private const PER_PAGE = 500; /** diff --git a/tests/MyEp/Api/ApiClientTest.php b/tests/MyEp/Api/ApiClientTest.php index 398857f..4c5acee 100644 --- a/tests/MyEp/Api/ApiClientTest.php +++ b/tests/MyEp/Api/ApiClientTest.php @@ -44,7 +44,7 @@ class ApiClientTest extends TestCase return new MockResponse('[]'); }); - $this->getClientInstance($httpClient)->get('api/travels/export', ['page' => 2, 'perPage' => 500]); + $this->getClientInstance($httpClient)->get('api/exports/travels', ['page' => 2, 'perPage' => 500]); $this->assertStringContainsString('page=2', $requestedUrl); $this->assertStringContainsString('perPage=500', $requestedUrl); diff --git a/tests/MyEp/Import/TravelExportClientTest.php b/tests/MyEp/Import/TravelExportClientTest.php index c8ecd2c..f761585 100644 --- a/tests/MyEp/Import/TravelExportClientTest.php +++ b/tests/MyEp/Import/TravelExportClientTest.php @@ -48,6 +48,9 @@ class TravelExportClientTest extends TestCase $this->getClientInstance($httpClient)->fetchAll(); + // the path is asserted because it has already moved once - it was api/travels/export + // until MyE&P found that ambiguous against api/travels/{dateCode} + $this->assertStringStartsWith('https://myep.example/api/exports/travels?', $urls[0]); $this->assertStringContainsString('page=1', $urls[0]); $this->assertStringContainsString('page=2', $urls[1]); $this->assertStringContainsString('perPage=500', $urls[0]);