Fixed courses
This commit is contained in:
parent
51ac05f9d5
commit
505039a146
tests
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue