mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Also test PHP 7.2
This commit is contained in:
@@ -57,10 +57,13 @@ class TwoFactorControllerTest extends TestCase
|
||||
$truePref->data = true;
|
||||
$secretPreference = new Preference;
|
||||
$secretPreference->data = 'JZMES376Z6YXY4QZ';
|
||||
$langPreference = new Preference;
|
||||
$langPreference->data = 'en_US';
|
||||
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePref)->twice();
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference)->once();
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference)->once();
|
||||
Preferences::shouldReceive('get')->withArgs(['language', 'en_US'])->andReturn($langPreference);
|
||||
|
||||
$response = $this->get(route('two-factor.index'));
|
||||
$response->assertStatus(200);
|
||||
@@ -75,9 +78,13 @@ class TwoFactorControllerTest extends TestCase
|
||||
|
||||
$falsePreference = new Preference;
|
||||
$falsePreference->data = false;
|
||||
$langPreference = new Preference;
|
||||
$langPreference->data = 'en_US';
|
||||
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($falsePreference)->twice();
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn(null)->once();
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn(null)->once();
|
||||
Preferences::shouldReceive('get')->withArgs(['language', 'en_US'])->andReturn($langPreference);
|
||||
|
||||
$response = $this->get(route('two-factor.index'));
|
||||
$response->assertStatus(302);
|
||||
@@ -96,9 +103,13 @@ class TwoFactorControllerTest extends TestCase
|
||||
$truePref->data = true;
|
||||
$secretPreference = new Preference;
|
||||
$secretPreference->data = '';
|
||||
$langPreference = new Preference;
|
||||
$langPreference->data = 'en_US';
|
||||
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePref)->twice();
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference)->once();
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference)->once();
|
||||
Preferences::shouldReceive('get')->withArgs(['language', 'en_US'])->andReturn($langPreference);
|
||||
|
||||
$response = $this->get(route('two-factor.index'));
|
||||
$response->assertStatus(500);
|
||||
@@ -115,9 +126,13 @@ class TwoFactorControllerTest extends TestCase
|
||||
$truePreference->data = true;
|
||||
$secretPreference = new Preference;
|
||||
$secretPreference->data = 'JZMES376Z6YXY4QZ';
|
||||
$langPreference = new Preference;
|
||||
$langPreference->data = 'en_US';
|
||||
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePreference);
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference);
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference);
|
||||
Preferences::shouldReceive('get')->withArgs(['language', 'en_US'])->andReturn($langPreference);
|
||||
|
||||
$response = $this->get(route('two-factor.lost'));
|
||||
$response->assertStatus(200);
|
||||
|
Reference in New Issue
Block a user