summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2019-01-12 17:48:27 +0100
committerDaniel Kesselberg <mail@danielkesselberg.de>2019-01-30 19:10:53 +0100
commitf24fa2051d7c2866ced8cfe26bf147b3ce031082 (patch)
tree8880c43b83baf2b34741fb24f063afad216dc23d /tests
parentbe6475784ae39880ce4d2f338bcd8f40c2a4b082 (diff)
downloadnextcloud-server-f24fa2051d7c2866ced8cfe26bf147b3ce031082.tar.gz
nextcloud-server-f24fa2051d7c2866ced8cfe26bf147b3ce031082.zip
Publish event for app token create/update/delete
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/Controller/AuthSettingsControllerTest.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/Settings/Controller/AuthSettingsControllerTest.php b/tests/Settings/Controller/AuthSettingsControllerTest.php
index 1c957299e39..19344a23055 100644
--- a/tests/Settings/Controller/AuthSettingsControllerTest.php
+++ b/tests/Settings/Controller/AuthSettingsControllerTest.php
@@ -28,11 +28,13 @@ use OC\Authentication\Token\DefaultToken;
use OC\Authentication\Token\IProvider;
use OC\Authentication\Token\IToken;
use OC\Settings\Controller\AuthSettingsController;
+use OCP\Activity\IEvent;
+use OCP\Activity\IManager;
use OCP\AppFramework\Http\JSONResponse;
+use OCP\ILogger;
use OCP\IRequest;
use OCP\ISession;
use OCP\IUser;
-use OCP\IUserManager;
use OCP\Security\ISecureRandom;
use OCP\Session\Exceptions\SessionNotAvailableException;
use Test\TestCase;
@@ -44,7 +46,6 @@ class AuthSettingsControllerTest extends TestCase {
private $request;
/** @var IProvider|\PHPUnit_Framework_MockObject_MockObject */
private $tokenProvider;
- private $userManager;
private $session;
private $secureRandom;
private $uid;
@@ -54,13 +55,16 @@ class AuthSettingsControllerTest extends TestCase {
$this->request = $this->createMock(IRequest::class);
$this->tokenProvider = $this->createMock(IProvider::class);
- $this->userManager = $this->createMock(IUserManager::class);
$this->session = $this->createMock(ISession::class);
$this->secureRandom = $this->createMock(ISecureRandom::class);
$this->uid = 'jane';
- $this->user = $this->createMock(IUser::class);
- $this->controller = new AuthSettingsController('core', $this->request, $this->tokenProvider, $this->userManager, $this->session, $this->secureRandom, $this->uid);
+ $activityManager = $this->createMock(IManager::class);
+ $activityManager->method('generateEvent')
+ ->willReturn($this->createMock(IEvent::class));
+ $logger = $this->createMock(ILogger::class);
+
+ $this->controller = new AuthSettingsController('core', $this->request, $this->tokenProvider, $this->session, $this->secureRandom, $this->uid, $activityManager, $logger);
}
public function testIndex() {