Add course update fake

This commit is contained in:
philipp lang 2021-11-20 00:54:10 +01:00
parent 2cd75fe502
commit 986a5103df
2 changed files with 6 additions and 9 deletions
packages
tests/Feature/Course

@ -1 +1 @@
Subproject commit 8614f81eca34143732a1618492c13e674ce7e224 Subproject commit 64ce14910a9b43004ddb6561c64ea909bb119cee

View File

@ -102,24 +102,21 @@ class UpdateTest extends TestCase
]); ]);
} }
/*
public function testItReceivesUnknownErrors(): void public function testItReceivesUnknownErrors(): void
{ {
$this->login()->init(); $this->login()->init();
$member = Member::factory()->defaults()->inNami(123)->createOne(); app(CourseFake::class)->doesntUpdateWithError(123, 999);
$course = Course::factory()->inNami(456)->createOne(); $member = Member::factory()->defaults()->inNami(123)->has(CourseMember::factory()->inNami(999)->for(Course::factory()), 'courses')->createOne();
app(CourseFake::class)->doesntCreateWithError(123); $newCourse = Course::factory()->inNami(789)->create();
$response = $this->post("/member/{$member->id}/course", [ $response = $this->patch("/member/{$member->id}/course/{$member->courses->first()->id}", [
'course_id' => $course->id, 'course_id' => $newCourse->id,
'completed_at' => '2021-01-02', 'completed_at' => '2021-01-02',
'event_name' => '::event::', 'event_name' => '::event::',
'organizer' => '::org::', 'organizer' => '::org::',
]); ]);
$response->assertSessionHasErrors(['id' => 'Unbekannter Fehler']); $response->assertSessionHasErrors(['id' => 'Unbekannter Fehler']);
$this->assertDatabaseCount('course_member', 0);
} }
*/
} }