summaryrefslogtreecommitdiffstats
path: root/apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-07-14 09:18:39 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-07-14 16:01:14 +0200
commitfa9dfd83c97e7b97c78003f40667e3e25db27400 (patch)
tree8268bbf1aef181f00ec7a51252800a13cf801d55 /apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php
parent5dca062c975a7f4b3fbbef8f3b5354258255ec10 (diff)
downloadnextcloud-server-fa9dfd83c97e7b97c78003f40667e3e25db27400.tar.gz
nextcloud-server-fa9dfd83c97e7b97c78003f40667e3e25db27400.zip
Fix AppFramework services
* We can't just register an alias as the services need the appId to be injected. if we just register an alias this blows up since the main container doesn't have the appId. * Moved the Authtokens over to show the PoC works Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php')
-rw-r--r--apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php b/apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php
index e03e05c149a..f3d92051e46 100644
--- a/apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php
+++ b/apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php
@@ -30,7 +30,7 @@ use OC\Authentication\Token\DefaultToken;
use OC\Authentication\Token\IProvider as IAuthTokenProvider;
use OCA\Settings\Settings\Personal\Security\Authtokens;
use OCP\AppFramework\Http\TemplateResponse;
-use OCP\IInitialStateService;
+use OCP\AppFramework\Services\IInitialState;
use OCP\ISession;
use OCP\IUserSession;
use PHPUnit\Framework\MockObject\MockObject;
@@ -47,8 +47,8 @@ class AuthtokensTest extends TestCase {
/** @var IUserSession|MockObject */
private $userSession;
- /** @var IInitialStateService|MockObject */
- private $initialStateService;
+ /** @var IInitialState|MockObject */
+ private $initialState;
/** @var string */
private $uid;
@@ -62,14 +62,14 @@ class AuthtokensTest extends TestCase {
$this->authTokenProvider = $this->createMock(IAuthTokenProvider::class);
$this->session = $this->createMock(ISession::class);
$this->userSession = $this->createMock(IUserSession::class);
- $this->initialStateService = $this->createMock(IInitialStateService::class);
+ $this->initialState = $this->createMock(IInitialState::class);
$this->uid = 'test123';
$this->section = new Authtokens(
$this->authTokenProvider,
$this->session,
$this->userSession,
- $this->initialStateService,
+ $this->initialState,
$this->uid
);
}
@@ -97,9 +97,9 @@ class AuthtokensTest extends TestCase {
->method('getToken')
->with('session123')
->willReturn($sessionToken);
- $this->initialStateService->expects($this->at(0))
+ $this->initialState->expects($this->at(0))
->method('provideInitialState')
- ->with('settings', 'app_tokens', [
+ ->with('app_tokens', [
[
'id' => 100,
'name' => null,
@@ -121,9 +121,9 @@ class AuthtokensTest extends TestCase {
],
]);
- $this->initialStateService->expects($this->at(1))
+ $this->initialState->expects($this->at(1))
->method('provideInitialState')
- ->with('settings', 'can_create_app_token', true);
+ ->with('can_create_app_token', true);
$form = $this->section->getForm();