summaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-09-10 12:01:12 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-09-10 12:01:12 +0200
commitf889ea83739448bc39aa39cf64c9ddd8548c7701 (patch)
tree9e54c2fd8e1f3196c67d58f76e45417d4f50ccd8 /apps/workflowengine/tests
parent9eb7a318649b3ca2bf85ccdb1db5ecb3be0bde70 (diff)
downloadnextcloud-server-f889ea83739448bc39aa39cf64c9ddd8548c7701.tar.gz
nextcloud-server-f889ea83739448bc39aa39cf64c9ddd8548c7701.zip
fix manager tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/workflowengine/tests')
-rw-r--r--apps/workflowengine/tests/ManagerTest.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/workflowengine/tests/ManagerTest.php b/apps/workflowengine/tests/ManagerTest.php
index 14700881a9c..aac5e5eadf5 100644
--- a/apps/workflowengine/tests/ManagerTest.php
+++ b/apps/workflowengine/tests/ManagerTest.php
@@ -61,6 +61,8 @@ class ManagerTest extends TestCase {
protected $container;
/** @var MockObject|IUserSession */
protected $session;
+ /** @var MockObject|L10N */
+ protected $l;
protected function setUp() {
parent::setUp();
@@ -68,8 +70,8 @@ class ManagerTest extends TestCase {
$this->db = \OC::$server->getDatabaseConnection();
$this->container = $this->createMock(IServerContainer::class);
/** @var IL10N|MockObject $l */
- $l = $this->createMock(IL10N::class);
- $l->method('t')
+ $this->l = $this->createMock(IL10N::class);
+ $this->l->method('t')
->will($this->returnCallback(function($text, $parameters = []) {
return vsprintf($text, $parameters);
}));
@@ -81,7 +83,7 @@ class ManagerTest extends TestCase {
$this->manager = new Manager(
\OC::$server->getDatabaseConnection(),
$this->container,
- $l,
+ $this->l,
$this->eventDispatcher,
$this->logger,
$this->session
@@ -277,7 +279,7 @@ class ManagerTest extends TestCase {
return $this->createMock(IOperation::class);
} else if($class === File::class) {
return $this->getMockBuilder(File::class)
- ->setConstructorArgs([$this->createMock(L10N::class), $this->createMock(IURLGenerator::class), $this->createMock(IRootFolder::class)])
+ ->setConstructorArgs([$this->l, $this->createMock(IURLGenerator::class), $this->createMock(IRootFolder::class)])
->setMethodsExcept(['getEvents'])
->getMock();
}
@@ -302,12 +304,12 @@ class ManagerTest extends TestCase {
$check2 = ['class' => 'OCA\WFE\C33', 'operator' => 'eq', 'value' => 23456];
/** @noinspection PhpUnhandledExceptionInspection */
- $op = $this->manager->updateOperation($opId1, 'Test01a', [$check1, $check2], 'foohur', $adminScope, $entity, ['postDelete']);
+ $op = $this->manager->updateOperation($opId1, 'Test01a', [$check1, $check2], 'foohur', $adminScope, $entity, ['\OCP\Files::postDelete']);
$this->assertSame('Test01a', $op['name']);
$this->assertSame('foohur', $op['operation']);
/** @noinspection PhpUnhandledExceptionInspection */
- $op = $this->manager->updateOperation($opId2, 'Test02a', [$check1], 'barfoo', $userScope, $entity, ['postDelete']);
+ $op = $this->manager->updateOperation($opId2, 'Test02a', [$check1], 'barfoo', $userScope, $entity, ['\OCP\Files::postDelete']);
$this->assertSame('Test02a', $op['name']);
$this->assertSame('barfoo', $op['operation']);