X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/98ab3c1ffb6cbc851ec73c73a4310cbbbca2a6ce..refs/pull/3593/head:/tests/TestEmailTest.php diff --git a/tests/TestEmailTest.php b/tests/TestEmailTest.php index 76ff322ff..97f98225d 100644 --- a/tests/TestEmailTest.php +++ b/tests/TestEmailTest.php @@ -1,4 +1,6 @@ -asAdmin()->get('/settings/maintenance'); $formCssSelector = 'form[action$="/settings/maintenance/send-test-email"]'; - $pageView->assertElementExists($formCssSelector); - $pageView->assertElementContains($formCssSelector . ' button', 'Send Test Email'); + $this->withHtml($pageView)->assertElementExists($formCssSelector); + $this->withHtml($pageView)->assertElementContains($formCssSelector . ' button', 'Send Test Email'); } public function test_send_test_email_endpoint_sends_email_and_redirects_user_and_shows_notification() @@ -33,7 +34,7 @@ class TestEmailTest extends TestCase $this->app[Dispatcher::class] = $mockDispatcher; $exception = new \Exception('A random error occurred when testing an email'); - $mockDispatcher->shouldReceive('send')->andThrow($exception); + $mockDispatcher->shouldReceive('sendNow')->andThrow($exception); $admin = $this->getAdmin(); $sendReq = $this->actingAs($admin)->post('/settings/maintenance/send-test-email'); @@ -57,6 +58,4 @@ class TestEmailTest extends TestCase $sendReq = $this->actingAs($user)->post('/settings/maintenance/send-test-email'); Notification::assertSentTo($user, TestEmail::class); } - - -} \ No newline at end of file +}