From bbdc9e9dfb832c79dc91f73c64b40ea1de171958 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Mon, 1 Jul 2024 12:08:59 +0200 Subject: [PATCH] Fix tests --- app/Form/Actions/ExportSyncAction.php | 6 +++++- tests/Feature/Form/FormRegisterActionTest.php | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Form/Actions/ExportSyncAction.php b/app/Form/Actions/ExportSyncAction.php index 5c899baf..d9a9e65f 100644 --- a/app/Form/Actions/ExportSyncAction.php +++ b/app/Form/Actions/ExportSyncAction.php @@ -3,6 +3,7 @@ namespace App\Form\Actions; use App\Form\Models\Form; +use App\Form\Models\Participant; use App\Group; use Illuminate\Support\Collection; use Lorisleiva\Actions\Concerns\AsAction; @@ -15,7 +16,7 @@ class ExportSyncAction public Form $form; - public function handle(Form $form) + public function handle(Form $form): void { $this->form = $form; @@ -44,6 +45,9 @@ class ExportSyncAction $this->handle(Form::find($formId)); } + /** + * @param Collection $participants + */ private function allSheet(Collection $participants): TableDocumentData { $document = TableDocumentData::from(['title' => 'Anmeldungen für ' . $this->form->name, 'sheets' => []]); diff --git a/tests/Feature/Form/FormRegisterActionTest.php b/tests/Feature/Form/FormRegisterActionTest.php index 3301c465..ce0583eb 100644 --- a/tests/Feature/Form/FormRegisterActionTest.php +++ b/tests/Feature/Form/FormRegisterActionTest.php @@ -43,7 +43,6 @@ class FormRegisterActionTest extends FormTestCase ]), ]) ->create(); - ExportSyncAction::shouldRun()->shouldReceive('asJob')->once()->with($form->id); $this->register($form, ['vorname' => 'Max', 'nachname' => 'Muster', 'spitzname' => 'Abraham']) ->assertOk();