fixed tests

This commit is contained in:
Philipp Lang 2023-05-05 12:28:22 +02:00
parent 593386b16b
commit 39a269d10a
1 changed files with 0 additions and 17 deletions
tests/Feature/Initialize

View File

@ -3,7 +3,6 @@
namespace Tests\Feature\Initialize;
use App\Initialize\Actions\InitializeAction;
use App\Setting\NamiSettings;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\RequestFactories\InitializeRequestFactory;
use Tests\TestCase;
@ -23,22 +22,6 @@ class InitializeActionTest extends TestCase
$response->assertRedirect('/login');
}
public function testItSetsSettingsBeforeRunningInitializer(): void
{
$this->withoutExceptionHandling()->login();
InitializeAction::partialMock()->shouldReceive('handle')->andReturn(true);
Auth::success(12345, 'secret');
app(GroupFake::class)->fetches(null, [185 => ['name' => 'testgroup']]);
$response = $this->post('/initialize', $this->factory()->withCredentials(12345, 'secret')->withGroup(185)->create());
$response->assertRedirect('/');
$settings = app(NamiSettings::class);
$this->assertEquals(12345, $settings->mglnr);
$this->assertEquals('secret', $settings->password);
$this->assertEquals(185, $settings->default_group_id);
}
public function testItValidatesSetupInfo(): void
{
$this->login();