From 35832a6993c70ef5cb0e9ba518476d801c500264 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Mon, 23 Jul 2018 09:33:55 +0800 Subject: [PATCH] Add `Mailable` test --- tests/AuthControllerTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/AuthControllerTest.php b/tests/AuthControllerTest.php index 8cba7e30..2b4c8c15 100644 --- a/tests/AuthControllerTest.php +++ b/tests/AuthControllerTest.php @@ -433,6 +433,14 @@ class AuthControllerTest extends TestCase 'errno' => 2, 'msg' => trans('auth.mail.failed', ['msg' => 'A fake exception.']) ]); + + // Addition: Mailable test + $site_name = option_localized('site_name'); + $mailable = new ForgotPassword('url'); + $mailable->build(); + $this->assertTrue($mailable->hasFrom(config('mail.username'), $site_name)); + $this->assertEquals(trans('auth.mail.title', ['sitename' => $site_name]), $mailable->subject); + $this->assertEquals('auth.mail', $mailable->view); } public function testReset()