aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/tests/ManagerTest.php
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2020-01-07 09:58:40 +0100
committerGitHub <noreply@github.com>2020-01-07 09:58:40 +0100
commit55fd157f15fa264b1170da4ebce830349fc85991 (patch)
treebe26a1726445840e547e1128a3383612879bf31a /apps/workflowengine/tests/ManagerTest.php
parent1b8f81617079cd49fb35d9d893370815ea5d05c1 (diff)
parent25d4f3230d840d88191f905b2f3767d982c311b6 (diff)
downloadnextcloud-server-55fd157f15fa264b1170da4ebce830349fc85991.tar.gz
nextcloud-server-55fd157f15fa264b1170da4ebce830349fc85991.zip
Merge pull request #18535 from nextcloud/enh/flow/newDispatcher
Use the new Events in Flow
Diffstat (limited to 'apps/workflowengine/tests/ManagerTest.php')
-rw-r--r--apps/workflowengine/tests/ManagerTest.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/workflowengine/tests/ManagerTest.php b/apps/workflowengine/tests/ManagerTest.php
index 82f1653ef25..22d323a9436 100644
--- a/apps/workflowengine/tests/ManagerTest.php
+++ b/apps/workflowengine/tests/ManagerTest.php
@@ -26,6 +26,7 @@ use OC\L10N\L10N;
use OCA\WorkflowEngine\Entity\File;
use OCA\WorkflowEngine\Helper\ScopeContext;
use OCA\WorkflowEngine\Manager;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\IRootFolder;
use OCP\IDBConnection;
use OCP\IL10N;
@@ -57,13 +58,15 @@ class ManagerTest extends TestCase {
/** @var \PHPUnit\Framework\MockObject\MockObject|ILogger */
protected $logger;
/** @var \PHPUnit\Framework\MockObject\MockObject|EventDispatcherInterface */
- protected $eventDispatcher;
+ protected $legacyDispatcher;
/** @var MockObject|IServerContainer */
protected $container;
/** @var MockObject|IUserSession */
protected $session;
/** @var MockObject|L10N */
protected $l;
+ /** @var MockObject|IEventDispatcher */
+ protected $dispatcher;
protected function setUp(): void {
parent::setUp();
@@ -77,17 +80,19 @@ class ManagerTest extends TestCase {
return vsprintf($text, $parameters);
}));
- $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
+ $this->legacyDispatcher = $this->createMock(EventDispatcherInterface::class);
$this->logger = $this->createMock(ILogger::class);
$this->session = $this->createMock(IUserSession::class);
+ $this->dispatcher = $this->createMock(IEventDispatcher::class);
$this->manager = new Manager(
\OC::$server->getDatabaseConnection(),
$this->container,
$this->l,
- $this->eventDispatcher,
+ $this->legacyDispatcher,
$this->logger,
- $this->session
+ $this->session,
+ $this->dispatcher
);
$this->clearTables();
}
@@ -402,7 +407,7 @@ class ManagerTest extends TestCase {
/** @var MockObject|IEntity $extraEntity */
$extraEntity = $this->createMock(IEntity::class);
- $this->eventDispatcher->expects($this->once())
+ $this->legacyDispatcher->expects($this->once())
->method('dispatch')
->with('OCP\WorkflowEngine::registerEntities', $this->anything())
->willReturnCallback(function() use ($extraEntity) {