diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-22 15:04:39 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-01-02 16:40:49 +0100 |
commit | 25d4f3230d840d88191f905b2f3767d982c311b6 (patch) | |
tree | e37bb6b7784144a6c97800750aaa302637e04f0f /apps/workflowengine/tests/ManagerTest.php | |
parent | c347b7cc148f69f12f7d8e98e3e6fee3a026d11c (diff) | |
download | nextcloud-server-25d4f3230d840d88191f905b2f3767d982c311b6.tar.gz nextcloud-server-25d4f3230d840d88191f905b2f3767d982c311b6.zip |
Use the new Events in Flow
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/workflowengine/tests/ManagerTest.php')
-rw-r--r-- | apps/workflowengine/tests/ManagerTest.php | 15 |
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) { |