Also use IMailer interface to generate the email template
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
f29d53f509
commit
952caf8f85
|
@ -115,11 +115,7 @@ class NewUserMailHelper {
|
||||||
$link = $this->urlGenerator->getAbsoluteURL('/');
|
$link = $this->urlGenerator->getAbsoluteURL('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
$emailTemplate = new EMailTemplate(
|
$emailTemplate = $this->mailer->createEMailTemplate();
|
||||||
$this->themingDefaults,
|
|
||||||
$this->urlGenerator,
|
|
||||||
$this->l10n
|
|
||||||
);
|
|
||||||
$emailTemplate->addHeader();
|
$emailTemplate->addHeader();
|
||||||
$displayName = $user->getDisplayName();
|
$displayName = $user->getDisplayName();
|
||||||
$userName = $user->getUID();
|
$userName = $user->getUID();
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
namespace Tests\Settings\Mailer;
|
namespace Tests\Settings\Mailer;
|
||||||
|
|
||||||
|
use OC\Mail\EMailTemplate;
|
||||||
use OCP\Mail\IEMailTemplate;
|
use OCP\Mail\IEMailTemplate;
|
||||||
use OC\Mail\Message;
|
use OC\Mail\Message;
|
||||||
use OC\Settings\Mailer\NewUserMailHelper;
|
use OC\Settings\Mailer\NewUserMailHelper;
|
||||||
|
@ -62,6 +63,13 @@ class NewUserMailHelperTest extends TestCase {
|
||||||
$this->urlGenerator = $this->createMock(IURLGenerator::class);
|
$this->urlGenerator = $this->createMock(IURLGenerator::class);
|
||||||
$this->l10n = $this->createMock(IL10N::class);
|
$this->l10n = $this->createMock(IL10N::class);
|
||||||
$this->mailer = $this->createMock(IMailer::class);
|
$this->mailer = $this->createMock(IMailer::class);
|
||||||
|
$template = new EMailTemplate(
|
||||||
|
$this->defaults,
|
||||||
|
$this->urlGenerator,
|
||||||
|
$this->l10n
|
||||||
|
);
|
||||||
|
$this->mailer->method('createEMailTemplate')
|
||||||
|
->will($this->return($template));
|
||||||
$this->secureRandom = $this->createMock(ISecureRandom::class);
|
$this->secureRandom = $this->createMock(ISecureRandom::class);
|
||||||
$this->timeFactory = $this->createMock(ITimeFactory::class);
|
$this->timeFactory = $this->createMock(ITimeFactory::class);
|
||||||
$this->config = $this->createMock(IConfig::class);
|
$this->config = $this->createMock(IConfig::class);
|
||||||
|
|
Loading…
Reference in New Issue