This commit is contained in:
philipp lang 2021-11-18 19:55:03 +01:00
parent 0e39d41bbf
commit e0a72c4f0f
3 changed files with 2 additions and 7 deletions
app/Nami
tests

View File

@ -7,7 +7,7 @@ use Exception;
trait HasNamiField trait HasNamiField
{ {
public static function nami(int $id): ?self public static function nami(int $id): self
{ {
$model = static::firstWhere('nami_id', $id); $model = static::firstWhere('nami_id', $id);

View File

@ -22,7 +22,7 @@ class InitializeTest extends TestCase
public function initializeProvider(callable $callback = null): void public function initializeProvider(callable $callback = null): void
{ {
$backend = app(FakeBackend::class) $backend = app(FakeBackend::class)
->fakeLogin('123', []) ->fakeLogin('123')
->addSearch(123, ['entries_vorname' => '::firstname::', 'entries_nachname' => '::lastname::', 'entries_gruppierungId' => 1000]) ->addSearch(123, ['entries_vorname' => '::firstname::', 'entries_nachname' => '::lastname::', 'entries_gruppierungId' => 1000])
->fakeNationalities([['name' => 'deutsch', 'id' => 291]]) ->fakeNationalities([['name' => 'deutsch', 'id' => 291]])
->fakeFees(1000, [['name' => 'Family', 'id' => 300]]) ->fakeFees(1000, [['name' => 'Family', 'id' => 300]])
@ -40,7 +40,6 @@ class InitializeTest extends TestCase
'beitragsartId' => 300, 'beitragsartId' => 300,
'geburtsDatum' => '2014-07-11 00:00:00', 'geburtsDatum' => '2014-07-11 00:00:00',
'gruppierungId' => 1000, 'gruppierungId' => 1000,
'geschlechtId' => 303,
'id' => 411, 'id' => 411,
'eintrittsdatum' => '2020-11-17 00:00:00', 'eintrittsdatum' => '2020-11-17 00:00:00',
'geschlechtId' => 303, 'geschlechtId' => 303,
@ -219,7 +218,6 @@ class InitializeTest extends TestCase
'geschlechtId' => 303, 'geschlechtId' => 303,
'id' => 116, 'id' => 116,
'eintrittsdatum' => '2020-11-17 00:00:00', 'eintrittsdatum' => '2020-11-17 00:00:00',
'geschlechtId' => 303,
'landId' => 302, 'landId' => 302,
'staatsangehoerigkeitId' => 291, 'staatsangehoerigkeitId' => 291,
'zeitschriftenversand' => true, 'zeitschriftenversand' => true,

View File

@ -6,19 +6,16 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Testing\TestResponse; use Illuminate\Testing\TestResponse;
use Tests\Lib\InertiaMixin; use Tests\Lib\InertiaMixin;
use Zoomyboy\LaravelNami\Backend\FakeBackend; use Zoomyboy\LaravelNami\Backend\FakeBackend;
use Zoomyboy\LaravelNami\FakesNami;
use Zoomyboy\LaravelNami\Nami; use Zoomyboy\LaravelNami\Nami;
use Zoomyboy\LaravelNami\NamiUser; use Zoomyboy\LaravelNami\NamiUser;
abstract class TestCase extends BaseTestCase abstract class TestCase extends BaseTestCase
{ {
use CreatesApplication; use CreatesApplication;
use FakesNami;
public function setUp(): void { public function setUp(): void {
parent::setUp(); parent::setUp();
$this->fakeNami();
TestResponse::mixin(new InertiaMixin()); TestResponse::mixin(new InertiaMixin());
} }