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:
parent
1c811a0550
commit
e62ea5bf0a
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue