mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix test coverage.
This commit is contained in:
@@ -98,9 +98,6 @@ class ProfileControllerTest extends TestCase
|
||||
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->atLeast()->once()->andReturn(true);
|
||||
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'demo'])->atLeast()->once()->andReturn(false);
|
||||
|
||||
// set recovery codes.
|
||||
Preferences::shouldReceive('set')->withArgs(['mfa_recovery', Mockery::any()])->atLeast()->once();
|
||||
|
||||
Google2FA::shouldReceive('generateSecretKey')->andReturn('secret');
|
||||
Google2FA::shouldReceive('getQRCodeInline')->andReturn('long-data-url');
|
||||
|
||||
@@ -448,6 +445,16 @@ class ProfileControllerTest extends TestCase
|
||||
|
||||
$userRepos->shouldReceive('setMFACode')->withArgs([Mockery::any(), $secret])->atLeast()->once();
|
||||
|
||||
// set recovery history
|
||||
Preferences::shouldReceive('set')->withArgs(['mfa_history', Mockery::any()])->atLeast()->once();
|
||||
|
||||
// set recovery codes.
|
||||
Preferences::shouldReceive('set')->withArgs(['mfa_recovery', null])->atLeast()->once();
|
||||
|
||||
$pref = new Preference;
|
||||
$pref->data= [];
|
||||
Preferences::shouldReceive('get')->withArgs(['mfa_history', []])->atLeast()->once()->andReturn($pref);
|
||||
|
||||
Preferences::shouldReceive('mark')->once();
|
||||
Google2FA::shouldReceive('verifyKey')->withArgs([$secret, $key])->andReturn(true);
|
||||
|
||||
|
@@ -50,6 +50,7 @@ class CreateControllerTest extends TestCase
|
||||
public function testCreate(): void
|
||||
{
|
||||
$this->mockDefaultSession();
|
||||
$this->mockIntroPreference('shown_demo_transactions_create_withdrawal');
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$cash = $this->getRandomAsset();
|
||||
@@ -63,7 +64,7 @@ class CreateControllerTest extends TestCase
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.create'));
|
||||
$response = $this->get(route('transactions.create', ['withdrawal']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
@@ -133,7 +133,7 @@ class LinkControllerTest extends TestCase
|
||||
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
$response->assertRedirect(route('transactions.show', [$withdrawal->id]));
|
||||
$response->assertRedirect(route('transactions.show', [$withdrawal->transaction_group_id]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user