From 479c427f2a3328ccf34b5ef57598eb8fc305f995 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 27 Sep 2016 21:12:24 +0200 Subject: [PATCH] Add IL10N to unit test Signed-off-by: Lukas Reschke --- apps/dav/tests/unit/DAV/HookManagerTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/dav/tests/unit/DAV/HookManagerTest.php b/apps/dav/tests/unit/DAV/HookManagerTest.php index 4a60542a01d..e9351ebc84a 100644 --- a/apps/dav/tests/unit/DAV/HookManagerTest.php +++ b/apps/dav/tests/unit/DAV/HookManagerTest.php @@ -28,11 +28,26 @@ use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\CardDAV\SyncService; use OCA\DAV\HookManager; +use OCP\IL10N; use OCP\IUser; use OCP\IUserManager; use Test\TestCase; class HookManagerTest extends TestCase { + /** @var IL10N */ + private $l10n; + + public function setUp() { + parent::setUp(); + $this->l10n = $this->createMock(IL10N::class); + $this->l10n + ->expects($this->any()) + ->method('t') + ->will($this->returnCallback(function ($text, $parameters = []) { + return vsprintf($text, $parameters); + })); + } + public function test() { $user = $this->getMockBuilder(IUser::class) ->disableOriginalConstructor()