Skip to content

Commit

Permalink
fixup! Files first to use own GenericEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
blizzz committed Nov 25, 2019
1 parent b873bf9 commit 5c0e179
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions tests/lib/Files/Node/HookConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
use OC\Files\Node\Root;
use OC\Files\Storage\Temporary;
use OC\Files\View;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\GenericEvent as APIGenericEvent;
use OCP\Files\Node;
use OCP\ILogger;
use OCP\IUserManager;
Expand Down Expand Up @@ -146,7 +148,8 @@ public function testViewToNode(callable $operation, $expectedHook, $expectedEven
$dispatcherCalled = false;
/** @var Node $dispatcherNode */
$dispatcherNode = null;
$this->eventDispatcher->addListener($expectedEvent, function (GenericEvent $event) use (&$dispatcherCalled, &$dispatcherNode) {
$this->eventDispatcher->addListener($expectedEvent, function ($event) use (&$dispatcherCalled, &$dispatcherNode) {
/** @var GenericEvent|APIGenericEvent $event */
$dispatcherCalled = true;
$dispatcherNode = $event->getSubject();
});
Expand Down Expand Up @@ -206,7 +209,8 @@ public function testViewToNodeCopyRename(callable $operation, $expectedHook, $ex
$dispatcherSourceNode = null;
/** @var Node $dispatcherTargetNode */
$dispatcherTargetNode = null;
$this->eventDispatcher->addListener($expectedEvent, function (GenericEvent $event) use (&$dispatcherSourceNode, &$dispatcherTargetNode, &$dispatcherCalled) {
$this->eventDispatcher->addListener($expectedEvent, function ($event) use (&$dispatcherSourceNode, &$dispatcherTargetNode, &$dispatcherCalled) {
/** @var GenericEvent|APIGenericEvent $event */
$dispatcherCalled = true;
list($dispatcherSourceNode, $dispatcherTargetNode) = $event->getSubject();
});
Expand Down Expand Up @@ -237,7 +241,7 @@ public function testPostDeleteMeta() {
$dispatcherCalled = false;
/** @var Node $dispatcherNode */
$dispatcherNode = null;
$this->eventDispatcher->addListener('\OCP\Files::postDelete', function (GenericEvent $event) use (&$dispatcherCalled, &$dispatcherNode) {
$this->eventDispatcher->addListener('\OCP\Files::postDelete', function (APIGenericEvent $event) use (&$dispatcherCalled, &$dispatcherNode) {
$dispatcherCalled = true;
$dispatcherNode = $event->getSubject();
});
Expand Down
1 change: 0 additions & 1 deletion tests/lib/Files/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use OC\Files\Storage\Temporary;
use OC\Files\Stream\Quota;
use OC\Files\View;
use OCP\Constants;
use OCP\Files\Config\IMountProvider;
use OCP\Files\FileInfo;
use OCP\Files\Storage\IStorage;
Expand Down

0 comments on commit 5c0e179

Please sign in to comment.