diff options
Diffstat (limited to 'tests/Core/Controller/LostControllerTest.php')
-rw-r--r-- | tests/Core/Controller/LostControllerTest.php | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index 0bdc11f8a2f..196b1da352b 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -324,20 +324,9 @@ class LostControllerTest extends \Test\TestCase { ->with(['test@example.com' => 'ExistingUser']); $message ->expects($this->at(1)) - ->method('setSubject') - ->with(' password reset'); - $message - ->expects($this->at(2)) - ->method('setPlainBody') - ->with('text body'); - $message - ->expects($this->at(3)) - ->method('setHtmlBody') - ->with('HTML body'); - $message - ->expects($this->at(4)) ->method('setFrom') ->with(['lostpassword-noreply@localhost' => null]); + $emailTemplate = $this->createMock(IEMailTemplate::class); $emailTemplate->expects($this->any()) ->method('renderHtml') @@ -345,6 +334,12 @@ class LostControllerTest extends \Test\TestCase { $emailTemplate->expects($this->any()) ->method('renderText') ->willReturn('text body'); + + $message + ->expects($this->at(2)) + ->method('useTemplate') + ->with($emailTemplate); + $this->mailer ->expects($this->at(0)) ->method('createEMailTemplate') @@ -407,20 +402,9 @@ class LostControllerTest extends \Test\TestCase { ->with(['test@example.com' => 'ExistingUser']); $message ->expects($this->at(1)) - ->method('setSubject') - ->with(' password reset'); - $message - ->expects($this->at(2)) - ->method('setPlainBody') - ->with('text body'); - $message - ->expects($this->at(3)) - ->method('setHtmlBody') - ->with('HTML body'); - $message - ->expects($this->at(4)) ->method('setFrom') ->with(['lostpassword-noreply@localhost' => null]); + $emailTemplate = $this->createMock(IEMailTemplate::class); $emailTemplate->expects($this->any()) ->method('renderHtml') @@ -428,6 +412,12 @@ class LostControllerTest extends \Test\TestCase { $emailTemplate->expects($this->any()) ->method('renderText') ->willReturn('text body'); + + $message + ->expects($this->at(2)) + ->method('useTemplate') + ->with($emailTemplate); + $this->mailer ->expects($this->at(0)) ->method('createEMailTemplate') @@ -484,20 +474,9 @@ class LostControllerTest extends \Test\TestCase { ->with(['test@example.com' => 'ExistingUser']); $message ->expects($this->at(1)) - ->method('setSubject') - ->with(' password reset'); - $message - ->expects($this->at(2)) - ->method('setPlainBody') - ->with('text body'); - $message - ->expects($this->at(3)) - ->method('setHtmlBody') - ->with('HTML body'); - $message - ->expects($this->at(4)) ->method('setFrom') ->with(['lostpassword-noreply@localhost' => null]); + $emailTemplate = $this->createMock(IEMailTemplate::class); $emailTemplate->expects($this->any()) ->method('renderHtml') @@ -505,6 +484,12 @@ class LostControllerTest extends \Test\TestCase { $emailTemplate->expects($this->any()) ->method('renderText') ->willReturn('text body'); + + $message + ->expects($this->at(2)) + ->method('useTemplate') + ->with($emailTemplate); + $this->mailer ->expects($this->at(0)) ->method('createEMailTemplate') |