Fixed courses

This commit is contained in:
philipp lang 2022-08-30 23:39:02 +02:00
parent 51ac05f9d5
commit 505039a146
2 changed files with 10 additions and 2 deletions
tests

View File

@ -52,7 +52,7 @@ class StoreTest extends TestCase
*/
public function testItValidatesInput(array $payload, array $errors): void
{
$this->login();
$this->login()->withNamiSettings();
$member = Member::factory()->defaults()->createOne();
$course = Course::factory()->createOne();

View File

@ -28,12 +28,19 @@ abstract class TestCase extends BaseTestCase
public function loginNami(int $mglnr = 12345, string $password = 'password'): self
{
Auth::success($mglnr, $password);
$this->withNamiSettings($mglnr, $password);
Group::factory()->create(['nami_id' => 55]);
return $this;
}
public function withNamiSettings(int $mglnr = 12345, string $password = 'password'): self
{
NamiSettings::fake([
'mglnr' => $mglnr,
'password' => $password,
'default_group_id' => 55,
]);
Group::factory()->create(['nami_id' => 55]);
return $this;
}
@ -44,6 +51,7 @@ abstract class TestCase extends BaseTestCase
NamiSettings::fake([
'mglnr' => $mglnr,
'password' => $password,
'default_group_id' => 55,
]);
return $this;