Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/oauth2/tests/Controller/OauthApiControllerTest.php14
-rw-r--r--tests/lib/Lockdown/LockdownManagerTest.php6
2 files changed, 10 insertions, 10 deletions
diff --git a/apps/oauth2/tests/Controller/OauthApiControllerTest.php b/apps/oauth2/tests/Controller/OauthApiControllerTest.php
index e723877a7b4..24385e785e5 100644
--- a/apps/oauth2/tests/Controller/OauthApiControllerTest.php
+++ b/apps/oauth2/tests/Controller/OauthApiControllerTest.php
@@ -27,8 +27,8 @@ namespace OCA\OAuth2\Tests\Controller;
use OC\Authentication\Exceptions\ExpiredTokenException;
use OC\Authentication\Exceptions\InvalidTokenException;
-use OC\Authentication\Token\DefaultToken;
use OC\Authentication\Token\IProvider as TokenProvider;
+use OC\Authentication\Token\PublicKeyToken;
use OC\Security\Bruteforce\Throttler;
use OCA\OAuth2\Controller\OauthApiController;
use OCA\OAuth2\Db\AccessToken;
@@ -238,7 +238,7 @@ class OauthApiControllerTest extends TestCase {
'validrefresh'
)->willReturn('decryptedToken');
- $appToken = new DefaultToken();
+ $appToken = new PublicKeyToken();
$appToken->setUid('userId');
$this->tokenProvider->method('getTokenById')
->with(1337)
@@ -267,7 +267,7 @@ class OauthApiControllerTest extends TestCase {
$this->tokenProvider->expects($this->once())
->method('updateToken')
->with(
- $this->callback(function (DefaultToken $token) {
+ $this->callback(function (PublicKeyToken $token) {
return $token->getExpires() === 4600;
})
);
@@ -330,7 +330,7 @@ class OauthApiControllerTest extends TestCase {
'validrefresh'
)->willReturn('decryptedToken');
- $appToken = new DefaultToken();
+ $appToken = new PublicKeyToken();
$appToken->setUid('userId');
$this->tokenProvider->method('getTokenById')
->with(1337)
@@ -359,7 +359,7 @@ class OauthApiControllerTest extends TestCase {
$this->tokenProvider->expects($this->once())
->method('updateToken')
->with(
- $this->callback(function (DefaultToken $token) {
+ $this->callback(function (PublicKeyToken $token) {
return $token->getExpires() === 4600;
})
);
@@ -425,7 +425,7 @@ class OauthApiControllerTest extends TestCase {
'validrefresh'
)->willReturn('decryptedToken');
- $appToken = new DefaultToken();
+ $appToken = new PublicKeyToken();
$appToken->setUid('userId');
$this->tokenProvider->method('getTokenById')
->with(1337)
@@ -454,7 +454,7 @@ class OauthApiControllerTest extends TestCase {
$this->tokenProvider->expects($this->once())
->method('updateToken')
->with(
- $this->callback(function (DefaultToken $token) {
+ $this->callback(function (PublicKeyToken $token) {
return $token->getExpires() === 4600;
})
);
diff --git a/tests/lib/Lockdown/LockdownManagerTest.php b/tests/lib/Lockdown/LockdownManagerTest.php
index 2f9a410b7e3..9b05ea0e6a5 100644
--- a/tests/lib/Lockdown/LockdownManagerTest.php
+++ b/tests/lib/Lockdown/LockdownManagerTest.php
@@ -21,7 +21,7 @@
namespace Test\Lockdown;
-use OC\Authentication\Token\DefaultToken;
+use OC\Authentication\Token\PublicKeyToken;
use OC\Lockdown\LockdownManager;
use OCP\ISession;
use Test\TestCase;
@@ -43,7 +43,7 @@ class LockdownManagerTest extends TestCase {
}
public function testCanAccessFilesystemAllowed() {
- $token = new DefaultToken();
+ $token = new PublicKeyToken();
$token->setScope(['filesystem' => true]);
$manager = new LockdownManager($this->sessionCallback);
$manager->setToken($token);
@@ -51,7 +51,7 @@ class LockdownManagerTest extends TestCase {
}
public function testCanAccessFilesystemNotAllowed() {
- $token = new DefaultToken();
+ $token = new PublicKeyToken();
$token->setScope(['filesystem' => false]);
$manager = new LockdownManager($this->sessionCallback);
$manager->setToken($token);