login()->loginNami()->withoutExceptionHandling(); $formtemplate = Formtemplate::factory()->create(); FormtemplateRequest::new()->name('testname')->fake(); $this->patchJson(route('formtemplate.update', ['formtemplate' => $formtemplate])) ->assertOk(); $this->assertDatabaseHas('formtemplates', [ 'name' => 'Testname', ]); Event::assertDispatched(Succeeded::class, fn (Succeeded $event) => $event->message === 'Vorlage aktualisiert.'); } public function testNameIsRequired(): void { $this->login()->loginNami(); $this->postJson(route('formtemplate.store'), [ 'name' => '', 'config' => [ 'sections' => [] ] ])->assertJsonValidationErrors(['name' => 'Name ist erforderlich']); } }