aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/Mail/EMailTemplateTest.php9
-rw-r--r--tests/lib/Mail/MailerTest.php6
2 files changed, 11 insertions, 4 deletions
diff --git a/tests/lib/Mail/EMailTemplateTest.php b/tests/lib/Mail/EMailTemplateTest.php
index 4b4ff616d4e..a900b1fe47d 100644
--- a/tests/lib/Mail/EMailTemplateTest.php
+++ b/tests/lib/Mail/EMailTemplateTest.php
@@ -27,6 +27,7 @@ use OC\Mail\EMailTemplate;
use OCP\Defaults;
use OCP\IL10N;
use OCP\IURLGenerator;
+use OCP\L10N\IFactory;
use Test\TestCase;
class EMailTemplateTest extends TestCase {
@@ -34,7 +35,7 @@ class EMailTemplateTest extends TestCase {
private $defaults;
/** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
private $urlGenerator;
- /** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var IFactory|\PHPUnit_Framework_MockObject_MockObject */
private $l10n;
/** @var EMailTemplate */
private $emailTemplate;
@@ -44,7 +45,11 @@ class EMailTemplateTest extends TestCase {
$this->defaults = $this->createMock(Defaults::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
- $this->l10n = $this->createMock(IL10N::class);
+ $this->l10n = $this->createMock(IFactory::class);
+
+ $this->l10n->method('get')
+ ->with('lib', '')
+ ->willReturn($this->createMock(IL10N::class));
$this->emailTemplate = new EMailTemplate(
$this->defaults,
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php
index 996048452bb..9e7f6a4134c 100644
--- a/tests/lib/Mail/MailerTest.php
+++ b/tests/lib/Mail/MailerTest.php
@@ -20,6 +20,7 @@ use OCP\IConfig;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IURLGenerator;
+use OCP\L10N\IFactory;
use OCP\Mail\Events\BeforeMessageSent;
use Test\TestCase;
use Swift_SwiftException;
@@ -56,7 +57,8 @@ class MailerTest extends TestCase {
$this->defaults,
$this->urlGenerator,
$this->l10n,
- $this->dispatcher
+ $this->dispatcher,
+ $this->createMock(IFactory::class)
);
}
@@ -153,7 +155,7 @@ class MailerTest extends TestCase {
$this->assertInstanceOf('\OC\Mail\Message', $this->mailer->createMessage());
}
-
+
public function testSendInvalidMailException() {
$this->expectException(\Exception::class);