Add IL10N to unit test

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2016-09-27 21:12:24 +02:00
parent da1543eef7
commit 479c427f2a
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 15 additions and 0 deletions

View File

@ -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()