aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-06-25 11:48:16 +0200
committerGitHub <noreply@github.com>2019-06-25 11:48:16 +0200
commit5fbf304c2a1f5d2c5e6a68c28e11c5004bf79646 (patch)
tree30a930b15790dd65132e4dd5a31e2d2f057751ea /apps/dav
parentaab447521c53d15b4c4ad23a620e94332a1b987d (diff)
parent3174012adf3fde4de74efa12cfa7e480b874b295 (diff)
downloadnextcloud-server-5fbf304c2a1f5d2c5e6a68c28e11c5004bf79646.tar.gz
nextcloud-server-5fbf304c2a1f5d2c5e6a68c28e11c5004bf79646.zip
Merge pull request #15777 from nextcloud/feature/ocp-event-dispatcher
Add event dispatcher to OCP
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/HookManager.php6
-rw-r--r--apps/dav/tests/unit/CardDAV/ConverterTest.php14
-rw-r--r--apps/dav/tests/unit/DAV/HookManagerTest.php6
3 files changed, 8 insertions, 18 deletions
diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php
index 27b6525be47..272c4cd1ad3 100644
--- a/apps/dav/lib/HookManager.php
+++ b/apps/dav/lib/HookManager.php
@@ -32,7 +32,7 @@ use OCA\DAV\CardDAV\SyncService;
use OCP\IUser;
use OCP\IUserManager;
use OCP\Util;
-use Symfony\Component\EventDispatcher\EventDispatcher;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class HookManager {
@@ -57,14 +57,14 @@ class HookManager {
/** @var array */
private $addressBooksToDelete = [];
- /** @var EventDispatcher */
+ /** @var EventDispatcherInterface */
private $eventDispatcher;
public function __construct(IUserManager $userManager,
SyncService $syncService,
CalDavBackend $calDav,
CardDavBackend $cardDav,
- EventDispatcher $eventDispatcher) {
+ EventDispatcherInterface $eventDispatcher) {
$this->userManager = $userManager;
$this->syncService = $syncService;
$this->calDav = $calDav;
diff --git a/apps/dav/tests/unit/CardDAV/ConverterTest.php b/apps/dav/tests/unit/CardDAV/ConverterTest.php
index 757d69659e8..dbb035a33d3 100644
--- a/apps/dav/tests/unit/CardDAV/ConverterTest.php
+++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php
@@ -32,7 +32,6 @@ use OCP\IDBConnection;
use OCP\IImage;
use OCP\IUser;
use PHPUnit_Framework_MockObject_MockObject;
-use Symfony\Component\EventDispatcher\EventDispatcher;
use Test\TestCase;
class ConverterTest extends TestCase {
@@ -40,19 +39,10 @@ class ConverterTest extends TestCase {
/** @var AccountManager | PHPUnit_Framework_MockObject_MockObject */
private $accountManager;
- /** @var EventDispatcher | PHPUnit_Framework_MockObject_MockObject */
- private $eventDispatcher;
-
- /** @var IDBConnection | PHPUnit_Framework_MockObject_MockObject */
- private $databaseConnection;
-
public function setUp() {
parent::setUp();
- $this->databaseConnection = $this->getMockBuilder(IDBConnection::class)->getMock();
- $this->eventDispatcher = $this->getMockBuilder(EventDispatcher::class)
- ->disableOriginalConstructor()->getMock();
- $this->accountManager = $this->getMockBuilder(AccountManager::class)
- ->disableOriginalConstructor()->getMock();
+
+ $this->accountManager = $this->createMock(AccountManager::class);
}
public function getAccountManager(IUser $user) {
diff --git a/apps/dav/tests/unit/DAV/HookManagerTest.php b/apps/dav/tests/unit/DAV/HookManagerTest.php
index 25219b7a8f2..75baf8257da 100644
--- a/apps/dav/tests/unit/DAV/HookManagerTest.php
+++ b/apps/dav/tests/unit/DAV/HookManagerTest.php
@@ -36,19 +36,19 @@ use OCA\DAV\HookManager;
use OCP\IL10N;
use OCP\IUser;
use OCP\IUserManager;
-use Symfony\Component\EventDispatcher\EventDispatcher;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase;
class HookManagerTest extends TestCase {
/** @var IL10N */
private $l10n;
- /** @var EventDispatcher | \PHPUnit_Framework_MockObject_MockObject */
+ /** @var EventDispatcherInterface | \PHPUnit_Framework_MockObject_MockObject */
private $eventDispatcher;
public function setUp() {
parent::setUp();
- $this->eventDispatcher = $this->getMockBuilder(EventDispatcher::class)->disableOriginalConstructor()->getMock();
+ $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
$this->l10n = $this->createMock(IL10N::class);
$this->l10n
->expects($this->any())