summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/DAV/HookManagerTest.php
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-11-17 10:27:46 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-21 11:29:59 +0100
commit3a880879ce373e490e0964b0db503c7d098cb43e (patch)
tree57b8e6e91086c018ee5ccb34fecb617688033ee8 /apps/dav/tests/unit/DAV/HookManagerTest.php
parent08e6541a882221e22e2f90efae9e807d88ba1e45 (diff)
downloadnextcloud-server-3a880879ce373e490e0964b0db503c7d098cb43e.tar.gz
nextcloud-server-3a880879ce373e490e0964b0db503c7d098cb43e.zip
update unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/dav/tests/unit/DAV/HookManagerTest.php')
-rw-r--r--apps/dav/tests/unit/DAV/HookManagerTest.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/dav/tests/unit/DAV/HookManagerTest.php b/apps/dav/tests/unit/DAV/HookManagerTest.php
index f980e595bf9..9579ce1c6d3 100644
--- a/apps/dav/tests/unit/DAV/HookManagerTest.php
+++ b/apps/dav/tests/unit/DAV/HookManagerTest.php
@@ -31,14 +31,19 @@ use OCA\DAV\HookManager;
use OCP\IL10N;
use OCP\IUser;
use OCP\IUserManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase;
class HookManagerTest extends TestCase {
/** @var IL10N */
private $l10n;
+ /** @var EventDispatcher | \PHPUnit_Framework_MockObject_MockObject */
+ private $eventDispatcher;
+
public function setUp() {
parent::setUp();
+ $this->eventDispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher')->disableOriginalConstructor()->getMock();
$this->l10n = $this->createMock(IL10N::class);
$this->l10n
->expects($this->any())
@@ -82,7 +87,7 @@ class HookManagerTest extends TestCase {
'principals/users/newUser',
'contacts', ['{DAV:}displayname' => 'Contacts']);
- $hm = new HookManager($userManager, $syncService, $cal, $card);
+ $hm = new HookManager($userManager, $syncService, $cal, $card, $this->eventDispatcher);
$hm->firstLogin($user);
}
@@ -116,7 +121,7 @@ class HookManagerTest extends TestCase {
$card->expects($this->once())->method('getAddressBooksForUserCount')->willReturn(1);
$card->expects($this->never())->method('createAddressBook');
- $hm = new HookManager($userManager, $syncService, $cal, $card);
+ $hm = new HookManager($userManager, $syncService, $cal, $card, $this->eventDispatcher);
$hm->firstLogin($user);
}
@@ -154,7 +159,7 @@ class HookManagerTest extends TestCase {
'principals/users/newUser',
'contacts', ['{DAV:}displayname' => 'Contacts']);
- $hm = new HookManager($userManager, $syncService, $cal, $card);
+ $hm = new HookManager($userManager, $syncService, $cal, $card, $this->eventDispatcher);
$hm->firstLogin($user);
}
@@ -195,7 +200,7 @@ class HookManagerTest extends TestCase {
]);
$card->expects($this->once())->method('deleteAddressBook');
- $hm = new HookManager($userManager, $syncService, $cal, $card, $this->l10n);
+ $hm = new HookManager($userManager, $syncService, $cal, $card, $this->eventDispatcher);
$hm->preDeleteUser(['uid' => 'newUser']);
$hm->postDeleteUser(['uid' => 'newUser']);
}