adrema/tests/TestCase.php

37 lines
904 B
PHP
Raw Normal View History

2020-04-10 20:32:12 +02:00
<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
2021-07-17 15:58:38 +02:00
use Illuminate\Testing\TestResponse;
use Tests\Lib\InertiaMixin;
2021-11-17 22:44:07 +01:00
use Zoomyboy\LaravelNami\Backend\FakeBackend;
2021-06-13 11:30:31 +02:00
use Zoomyboy\LaravelNami\FakesNami;
use Zoomyboy\LaravelNami\Nami;
2021-06-18 23:36:06 +02:00
use Zoomyboy\LaravelNami\NamiUser;
2020-04-10 20:32:12 +02:00
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
2021-06-13 11:30:31 +02:00
use FakesNami;
public function setUp(): void {
parent::setUp();
$this->fakeNami();
2021-07-17 15:58:38 +02:00
TestResponse::mixin(new InertiaMixin());
2021-06-13 11:30:31 +02:00
}
2021-11-17 22:44:07 +01:00
public function login(): void
{
app(FakeBackend::class)
->fakeLogin('123')
->addSearch(123, ['entries_vorname' => '::firstname::', 'entries_nachname' => '::lastname::', 'entries_gruppierungId' => 1000]);
$this->post('/login', [
'mglnr' => 123,
'password' => 'secret',
2021-06-18 23:36:06 +02:00
]);
}
2020-04-10 20:32:12 +02:00
}