Fix tests.

This commit is contained in:
James Cole
2016-12-26 09:50:37 +01:00
parent 1ced4a089d
commit 7ea15761a6
2 changed files with 14 additions and 1 deletions

View File

@@ -48,7 +48,7 @@ class ConfigurationControllerTest extends TestCase
FireflyConfig::shouldReceive('get')->withArgs(['single_user_mode', true])->once()->andReturn($trueConfig);
FireflyConfig::shouldReceive('get')->withArgs(['must_confirm_account', false])->once()->andReturn($falseConfig);
FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig);
FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->times(2)->andReturn($falseConfig);
// new settings:
FireflyConfig::shouldReceive('get')->withArgs(['mail_for_lockout', false])->once()->andReturn($falseConfig);
@@ -69,7 +69,10 @@ class ConfigurationControllerTest extends TestCase
*/
public function testPostIndex()
{
$falseConfig = new Configuration;
$falseConfig->data = false;
FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig);
FireflyConfig::shouldReceive('set')->withArgs(['single_user_mode', false])->once();
FireflyConfig::shouldReceive('set')->withArgs(['must_confirm_account', false])->once();
FireflyConfig::shouldReceive('set')->withArgs(['is_demo_site', false])->once();

View File

@@ -48,6 +48,11 @@ class ConfirmationControllerTest extends TestCase
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($falsePreference);
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn(null);
$falseConfig = new Configuration;
$falseConfig->data = false;
FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig);
FireflyConfig::shouldReceive('get')->withArgs(['must_confirm_account', false])->andReturn($trueConfig);
$this->be($this->user());
$this->call('GET', route('confirmation_error'));
@@ -94,6 +99,11 @@ class ConfirmationControllerTest extends TestCase
$falsePreference = new Preference;
$falsePreference->data = false;
$falseConfig = new Configuration;
$falseConfig->data = false;
FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig);
Preferences::shouldReceive('get')->withArgs(['user_confirmed_last_mail', 0])->andReturn($timePreference);
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($falsePreference);
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn(null);