From e62ea5bf0a5a95e91b04dc1d369dfc8185647f74 Mon Sep 17 00:00:00 2001 From: Thorsten Bus Date: Mon, 6 Jul 2026 01:07:05 +0200 Subject: [PATCH] fix(export): align writeProFile test doubles with new options parameter Update anonymous PlaylistExportService subclasses in export tests to match the production writeProFile signature (added $options param) and to inject the now-required MacroResolutionService constructor dependency. --- tests/Feature/ExportBundleRelativeMediaTest.php | 3 ++- tests/Feature/ExportPreAddedProBundleTest.php | 3 ++- tests/Feature/ExportSkipEmptyLockedSongTest.php | 4 ++-- tests/Feature/PlaylistExportTest.php | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/Feature/ExportBundleRelativeMediaTest.php b/tests/Feature/ExportBundleRelativeMediaTest.php index 9d4b608..91e6177 100644 --- a/tests/Feature/ExportBundleRelativeMediaTest.php +++ b/tests/Feature/ExportBundleRelativeMediaTest.php @@ -67,10 +67,11 @@ public function test_playlist_export_setzt_bundle_relative_auf_info_folien_slide public function __construct(array &$captured) { + parent::__construct(app(\App\Services\MacroResolutionService::class)); $this->captured = &$captured; } - protected function writeProFile(string $path, string $name, array $groups, array $arrangements): void + protected function writeProFile(string $path, string $name, array $groups, array $arrangements, array $options = []): void { $this->captured[] = $groups; file_put_contents($path, 'mock-pro:'.$name); diff --git a/tests/Feature/ExportPreAddedProBundleTest.php b/tests/Feature/ExportPreAddedProBundleTest.php index 2104195..07101f1 100644 --- a/tests/Feature/ExportPreAddedProBundleTest.php +++ b/tests/Feature/ExportPreAddedProBundleTest.php @@ -106,11 +106,12 @@ public function test_vorab_hinzugefuegtes_probundle_ergibt_nicht_leere_playlist( public function __construct(array &$items, array &$files) { + parent::__construct(app(\App\Services\MacroResolutionService::class)); $this->items = &$items; $this->files = &$files; } - protected function writeProFile(string $path, string $name, array $groups, array $arrangements): void + protected function writeProFile(string $path, string $name, array $groups, array $arrangements, array $options = []): void { file_put_contents($path, 'mock-pro:'.$name); } diff --git a/tests/Feature/ExportSkipEmptyLockedSongTest.php b/tests/Feature/ExportSkipEmptyLockedSongTest.php index e33d1a7..1d5e641 100644 --- a/tests/Feature/ExportSkipEmptyLockedSongTest.php +++ b/tests/Feature/ExportSkipEmptyLockedSongTest.php @@ -71,9 +71,9 @@ private function createNormalSong(string $title = 'Normales Lied'): Song private function testable_export_service(): PlaylistExportService { - return new class extends PlaylistExportService + return new class(app(\App\Services\MacroResolutionService::class)) extends PlaylistExportService { - protected function writeProFile(string $path, string $name, array $groups, array $arrangements): void + protected function writeProFile(string $path, string $name, array $groups, array $arrangements, array $options = []): void { file_put_contents($path, 'mock-pro:'.$name); } diff --git a/tests/Feature/PlaylistExportTest.php b/tests/Feature/PlaylistExportTest.php index b812ae5..70c68dd 100644 --- a/tests/Feature/PlaylistExportTest.php +++ b/tests/Feature/PlaylistExportTest.php @@ -78,8 +78,9 @@ private function createSlide(array $attributes): Slide private function createTestableExportService(): PlaylistExportService { - return new class () extends PlaylistExportService { - protected function writeProFile(string $path, string $name, array $groups, array $arrangements): void + return new class(app(\App\Services\MacroResolutionService::class)) extends PlaylistExportService + { + protected function writeProFile(string $path, string $name, array $groups, array $arrangements, array $options = []): void { file_put_contents($path, 'mock-pro-file:'.$name); }