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.
This commit is contained in:
Thorsten Bus 2026-07-06 01:07:05 +02:00
parent 1c811a0550
commit e62ea5bf0a
4 changed files with 9 additions and 6 deletions

View file

@ -67,10 +67,11 @@ public function test_playlist_export_setzt_bundle_relative_auf_info_folien_slide
public function __construct(array &$captured) public function __construct(array &$captured)
{ {
parent::__construct(app(\App\Services\MacroResolutionService::class));
$this->captured = &$captured; $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; $this->captured[] = $groups;
file_put_contents($path, 'mock-pro:'.$name); file_put_contents($path, 'mock-pro:'.$name);

View file

@ -106,11 +106,12 @@ public function test_vorab_hinzugefuegtes_probundle_ergibt_nicht_leere_playlist(
public function __construct(array &$items, array &$files) public function __construct(array &$items, array &$files)
{ {
parent::__construct(app(\App\Services\MacroResolutionService::class));
$this->items = &$items; $this->items = &$items;
$this->files = &$files; $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); file_put_contents($path, 'mock-pro:'.$name);
} }

View file

@ -71,9 +71,9 @@ private function createNormalSong(string $title = 'Normales Lied'): Song
private function testable_export_service(): PlaylistExportService 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); file_put_contents($path, 'mock-pro:'.$name);
} }

View file

@ -78,8 +78,9 @@ private function createSlide(array $attributes): Slide
private function createTestableExportService(): PlaylistExportService private function createTestableExportService(): 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-file:'.$name); file_put_contents($path, 'mock-pro-file:'.$name);
} }