aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Controller
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-09-15 11:01:21 +0200
committerJoas Schilling <coding@schilljs.com>2017-10-18 15:12:03 +0200
commit3119fd41ceebbdab33c4dd86ce0b60b4dc9010e9 (patch)
treef79efab1f9506a452e54fd32e201234410969b1b /tests/Core/Controller
parentc9af36a9ab05e808df526a2054c30364ee02241c (diff)
downloadnextcloud-server-3119fd41ceebbdab33c4dd86ce0b60b4dc9010e9.tar.gz
nextcloud-server-3119fd41ceebbdab33c4dd86ce0b60b4dc9010e9.zip
Set the data from the template
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/Core/Controller')
-rw-r--r--tests/Core/Controller/LostControllerTest.php57
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')