diff --git a/tests/Unit/Http/Controllers/Admin/MailControllerTest.php b/tests/Unit/Http/Controllers/Admin/MailControllerTest.php new file mode 100644 index 00000000..e99fe392 --- /dev/null +++ b/tests/Unit/Http/Controllers/Admin/MailControllerTest.php @@ -0,0 +1,82 @@ +alert = m::mock(AlertsMessageBag::class); + $this->configRepository = m::mock(ConfigRepository::class); + $this->encrypter = m::mock(Encrypter::class); + $this->kernel = m::mock(Kernel::class); + $this->settingsRepositoryInterface = m::mock(SettingsRepositoryInterface::class); + } + + /** + * Test the mail controller for viewing mail settings page. + */ + public function testIndex() + { + $this->configRepository->shouldReceive('get'); + + $response = $this->getController()->index(); + + $this->assertIsViewResponse($response); + $this->assertViewNameEquals('admin.settings.mail', $response); + } + + /** + * Prepare a MailController using our mocks. + * + * @return MailController + */ + public function getController() + { + return new MailController( + $this->alert, + $this->configRepository, + $this->encrypter, + $this->kernel, + $this->settingsRepositoryInterface + ); + } +}