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
|
public function testItValidatesInput(array $payload, array $errors): void
|
||||||
{
|
{
|
||||||
$this->login();
|
$this->login()->withNamiSettings();
|
||||||
$member = Member::factory()->defaults()->createOne();
|
$member = Member::factory()->defaults()->createOne();
|
||||||
$course = Course::factory()->createOne();
|
$course = Course::factory()->createOne();
|
||||||
|
|
||||||
|
|
|
@ -28,12 +28,19 @@ abstract class TestCase extends BaseTestCase
|
||||||
public function loginNami(int $mglnr = 12345, string $password = 'password'): self
|
public function loginNami(int $mglnr = 12345, string $password = 'password'): self
|
||||||
{
|
{
|
||||||
Auth::success($mglnr, $password);
|
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([
|
NamiSettings::fake([
|
||||||
'mglnr' => $mglnr,
|
'mglnr' => $mglnr,
|
||||||
'password' => $password,
|
'password' => $password,
|
||||||
'default_group_id' => 55,
|
'default_group_id' => 55,
|
||||||
]);
|
]);
|
||||||
Group::factory()->create(['nami_id' => 55]);
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -44,6 +51,7 @@ abstract class TestCase extends BaseTestCase
|
||||||
NamiSettings::fake([
|
NamiSettings::fake([
|
||||||
'mglnr' => $mglnr,
|
'mglnr' => $mglnr,
|
||||||
'password' => $password,
|
'password' => $password,
|
||||||
|
'default_group_id' => 55,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
Loading…
Reference in New Issue