aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/User
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-06-12 18:34:54 +0200
committerRobin Appelman <robin@icewind.nl>2025-06-12 18:38:29 +0200
commit3561937816578a699008c010829142a01580e7bf (patch)
tree83544b8fccc08e8bb73b81ddbc426180f02bd13b /tests/lib/User
parent3cc34ac29da76e17952bfc84ddc1a5f066680d8f (diff)
downloadnextcloud-server-rector-tests.tar.gz
nextcloud-server-rector-tests.zip
chore: run rector on tests with new rulerector-tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/User')
-rw-r--r--tests/lib/User/SessionTest.php20
-rw-r--r--tests/lib/User/UserTest.php8
2 files changed, 14 insertions, 14 deletions
diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php
index 8e017772348..685b7c13d44 100644
--- a/tests/lib/User/SessionTest.php
+++ b/tests/lib/User/SessionTest.php
@@ -158,7 +158,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('getToken')
->with('bar')
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$session->expects($this->exactly(2))
->method('set')
->with($this->callback(function ($key) {
@@ -238,7 +238,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('getToken')
->with('bar')
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$managerMethods = get_class_methods(Manager::class);
//keep following methods intact in order to ensure hooks are working
@@ -298,7 +298,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('getToken')
->with('bar')
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$user->expects($this->never())
->method('isEnabled');
@@ -404,7 +404,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('getToken')
->with('bar')
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$manager->expects($this->once())
->method('checkPasswordNoLogging')
@@ -430,7 +430,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('getToken')
->with('doe')
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$this->config->expects($this->once())
->method('getSystemValueBool')
->with('token_auth_enforced', false)
@@ -466,7 +466,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('getToken')
->with('doe')
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$this->config->expects($this->once())
->method('getSystemValueBool')
->with('token_auth_enforced', false)
@@ -534,7 +534,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('getToken')
->with('doe')
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$this->config->expects($this->once())
->method('getSystemValueBool')
->with('token_auth_enforced', false)
@@ -788,7 +788,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('renewSessionToken')
->with($oldSessionId, $sessionId)
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$user->expects($this->never())
->method('getUID')
@@ -972,7 +972,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('getToken')
->with($password)
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$this->tokenProvider->expects($this->once())
->method('generateToken')
@@ -1013,7 +1013,7 @@ class SessionTest extends \Test\TestCase {
$this->tokenProvider->expects($this->once())
->method('getToken')
->with($password)
- ->will($this->throwException(new InvalidTokenException()));
+ ->willThrowException(new InvalidTokenException());
$this->tokenProvider->expects($this->once())
->method('generateToken')
diff --git a/tests/lib/User/UserTest.php b/tests/lib/User/UserTest.php
index d8073abf8c8..e386d0c2c10 100644
--- a/tests/lib/User/UserTest.php
+++ b/tests/lib/User/UserTest.php
@@ -832,9 +832,9 @@ class UserTest extends TestCase {
['files', 'allow_unlimited_quota', '1', '1'],
];
$config->method('getUserValue')
- ->will($this->returnValueMap($userValueMap));
+ ->willReturnMap($userValueMap);
$config->method('getAppValue')
- ->will($this->returnValueMap($appValueMap));
+ ->willReturnMap($appValueMap);
$this->assertEquals('none', $user->getQuota());
$this->assertEquals(FileInfo::SPACE_UNLIMITED, $user->getQuotaBytes());
@@ -866,9 +866,9 @@ class UserTest extends TestCase {
['files', 'default_quota', '1 GB', '1 GB'],
];
$config->method('getUserValue')
- ->will($this->returnValueMap($userValueMap));
+ ->willReturnMap($userValueMap);
$config->method('getAppValue')
- ->will($this->returnValueMap($appValueMap));
+ ->willReturnMap($appValueMap);
$this->assertEquals('1 GB', $user->getQuota());
$this->assertEquals(1024 * 1024 * 1024, $user->getQuotaBytes());