diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-10-16 12:36:03 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-10-17 13:31:48 +0200 |
commit | e8095cf7372a8e95ca0f57ada1ddb8712aebce9a (patch) | |
tree | 4646cb85b358b7dcb9db9d163bc648d19f294ca3 /apps | |
parent | 9f2d15ad5ce0e011de2594c7993714c3001c8c47 (diff) | |
download | nextcloud-server-e8095cf7372a8e95ca0f57ada1ddb8712aebce9a.tar.gz nextcloud-server-e8095cf7372a8e95ca0f57ada1ddb8712aebce9a.zip |
use OCP\EventDispatcher\Event over Symfony's deprecated Event
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps')
4 files changed, 14 insertions, 13 deletions
diff --git a/apps/dav/tests/unit/Comments/RootCollectionTest.php b/apps/dav/tests/unit/Comments/RootCollectionTest.php index fde74dc46e7..2391d885baf 100644 --- a/apps/dav/tests/unit/Comments/RootCollectionTest.php +++ b/apps/dav/tests/unit/Comments/RootCollectionTest.php @@ -25,6 +25,8 @@ namespace OCA\DAV\Tests\unit\Comments; +use OC\EventDispatcher\EventDispatcher; +use OC\EventDispatcher\SymfonyAdapter; use OCA\DAV\Comments\EntityTypeCollection as EntityTypeCollectionImplementation; use OCP\Comments\CommentsEntityEvent; use OCP\Comments\ICommentsManager; @@ -32,7 +34,7 @@ use OCP\ILogger; use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; -use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; class RootCollectionTest extends \Test\TestCase { @@ -46,7 +48,7 @@ class RootCollectionTest extends \Test\TestCase { protected $collection; /** @var \OCP\IUserSession|\PHPUnit_Framework_MockObject_MockObject */ protected $userSession; - /** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface */ + /** @var EventDispatcherInterface */ protected $dispatcher; /** @var \OCP\IUser|\PHPUnit_Framework_MockObject_MockObject */ protected $user; @@ -67,10 +69,17 @@ class RootCollectionTest extends \Test\TestCase { $this->userSession = $this->getMockBuilder(IUserSession::class) ->disableOriginalConstructor() ->getMock(); - $this->dispatcher = new EventDispatcher(); $this->logger = $this->getMockBuilder(ILogger::class) ->disableOriginalConstructor() ->getMock(); + $this->dispatcher = new SymfonyAdapter( + new EventDispatcher( + new \Symfony\Component\EventDispatcher\EventDispatcher(), + \OC::$server, + $this->logger + ), + $this->logger + ); $this->collection = new \OCA\DAV\Comments\RootCollection( $this->commentsManager, diff --git a/apps/files_trashbin/lib/Events/MoveToTrashEvent.php b/apps/files_trashbin/lib/Events/MoveToTrashEvent.php index 99b42507cec..e62d875c59d 100644 --- a/apps/files_trashbin/lib/Events/MoveToTrashEvent.php +++ b/apps/files_trashbin/lib/Events/MoveToTrashEvent.php @@ -26,7 +26,7 @@ namespace OCA\Files_Trashbin\Events; use OCP\Files\Node; -use Symfony\Component\EventDispatcher\Event; +use OCP\EventDispatcher\Event; /** * Class MoveToTrashEvent diff --git a/apps/files_versions/lib/Events/CreateVersionEvent.php b/apps/files_versions/lib/Events/CreateVersionEvent.php index 90d907147dd..0669034431b 100644 --- a/apps/files_versions/lib/Events/CreateVersionEvent.php +++ b/apps/files_versions/lib/Events/CreateVersionEvent.php @@ -24,10 +24,8 @@ namespace OCA\Files_Versions\Events; - use OCP\Files\Node; -use Symfony\Component\EventDispatcher\Event; - +use OCP\EventDispatcher\Event; /** * Class CreateVersionEvent diff --git a/apps/twofactor_backupcodes/tests/Unit/Migration/CheckBackupCodeTest.php b/apps/twofactor_backupcodes/tests/Unit/Migration/CheckBackupCodeTest.php index 6644fce7293..3c36a35f7c1 100644 --- a/apps/twofactor_backupcodes/tests/Unit/Migration/CheckBackupCodeTest.php +++ b/apps/twofactor_backupcodes/tests/Unit/Migration/CheckBackupCodeTest.php @@ -23,15 +23,9 @@ declare(strict_types=1); namespace OCA\TwoFactorBackupCodes\Tests\Unit\Migration; -use OCA\TwoFactorBackupCodes\Event\CodesGenerated; -use OCA\TwoFactorBackupCodes\Listener\RegistryUpdater; use OCA\TwoFactorBackupCodes\Migration\CheckBackupCodes; -use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider; -use OCP\Authentication\TwoFactorAuth\IRegistry; use OCP\BackgroundJob\IJobList; -use OCP\IUser; use OCP\Migration\IOutput; -use Symfony\Component\EventDispatcher\Event; use Test\TestCase; class CheckBackupCodeTest extends TestCase { |