diff --git a/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php b/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php index 0d4351fc5e..b212b656fd 100644 --- a/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php +++ b/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php @@ -30,7 +30,6 @@ class ConfigurationControllerTest extends TestCase { parent::setUp(); - FireflyConfig::shouldReceive('get')->withArgs(['must_confirm_account', false])->once(); } /** @@ -47,7 +46,6 @@ class ConfigurationControllerTest extends TestCase $trueConfig->data = true; 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])->times(2)->andReturn($falseConfig); $this->call('GET', route('admin.configuration.index')); @@ -67,7 +65,6 @@ class ConfigurationControllerTest extends TestCase 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(); $this->be($this->user()); diff --git a/tests/acceptance/Controllers/Auth/ConfirmationControllerTest.php b/tests/acceptance/Controllers/Auth/ConfirmationControllerTest.php deleted file mode 100644 index c1e5cfa0cb..0000000000 --- a/tests/acceptance/Controllers/Auth/ConfirmationControllerTest.php +++ /dev/null @@ -1,121 +0,0 @@ -data = true; - $falsePreference = new Preference; - $falsePreference->data = false; - - Preferences::shouldReceive('get')->withArgs(['user_confirmed', false])->andReturn($falsePreference); - 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')); - $this->assertResponseStatus(200); - $this->see('has been sent to the address you used during your registration'); - - } - - /** - * @covers \FireflyIII\Http\Controllers\Auth\ConfirmationController::doConfirmation - */ - public function testDoConfirmation() - { - $codePreference = new Preference; - $codePreference->data = 'abcde'; - $timePreference = new Preference; - $timePreference->data = 0; - $falsePreference = new Preference; - $falsePreference->data = false; - - Preferences::shouldReceive('get')->withArgs(['user_confirmed_code'])->andReturn($codePreference); - 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); - Preferences::shouldReceive('get')->withArgs(['user_confirmed', false])->andReturn($falsePreference); - - $this->be($this->user()); - $this->call('GET', route('do_confirm_account', ['abcde'])); - $this->assertResponseStatus(302); - $this->assertRedirectedToRoute('home'); - } - - /** - * @covers \FireflyIII\Http\Controllers\Auth\ConfirmationController::resendConfirmation - */ - public function testResendConfirmation() - { - $trueConfig = new Configuration; - $trueConfig->data = true; - $codePreference = new Preference; - $codePreference->data = 'abcde'; - $timePreference = new Preference; - $timePreference->data = 0; - $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); - FireflyConfig::shouldReceive('get')->withArgs(['must_confirm_account', false])->andReturn($trueConfig); - Preferences::shouldReceive('get')->withArgs(['user_confirmed', false])->andReturn($falsePreference); - - // from event handler: - Preferences::shouldReceive('setForUser')->withAnyArgs(); - - $this->be($this->user()); - $this->call('GET', route('resend_confirmation')); - $this->assertResponseStatus(200); - } - -}