summaryrefslogtreecommitdiffstats
path: root/tests/lib/User/UserTest.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-04-05 17:42:14 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-04-05 17:42:14 +0200
commit8d5165e8dc40289b5d523523c4140f780b2fe293 (patch)
treeb4d15f2bc67e16c94d7cdfdb893a773b415d2738 /tests/lib/User/UserTest.php
parent426c0341ffff262f58d1b7f031de4f0c53c8bec5 (diff)
downloadnextcloud-server-8d5165e8dc40289b5d523523c4140f780b2fe293.tar.gz
nextcloud-server-8d5165e8dc40289b5d523523c4140f780b2fe293.zip
Adapt tests to config value typing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests/lib/User/UserTest.php')
-rw-r--r--tests/lib/User/UserTest.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/lib/User/UserTest.php b/tests/lib/User/UserTest.php
index b8fa8efced0..7f4ca97e18b 100644
--- a/tests/lib/User/UserTest.php
+++ b/tests/lib/User/UserTest.php
@@ -306,7 +306,7 @@ class UserTest extends TestCase {
->method('getUserValue')
->willReturn(true);
$allConfig->expects($this->any())
- ->method('getSystemValue')
+ ->method('getSystemValueString')
->with($this->equalTo('datadirectory'))
->willReturn('arbitrary/path');
@@ -364,7 +364,12 @@ class UserTest extends TestCase {
}
});
- $user = new User('foo', $backend, $this->dispatcher);
+ $config = $this->createMock(IConfig::class);
+ $config->method('getSystemValueBool')
+ ->with('allow_user_to_change_display_name')
+ ->willReturn(true);
+
+ $user = new User('foo', $backend, $this->dispatcher, null, $config);
$this->assertTrue($user->canChangeDisplayName());
}
@@ -534,6 +539,12 @@ class UserTest extends TestCase {
$config->method('getSystemValue')
->willReturnArgument(1);
+ $config->method('getSystemValueString')
+ ->willReturnArgument(1);
+ $config->method('getSystemValueBool')
+ ->willReturnArgument(1);
+ $config->method('getSystemValueInt')
+ ->willReturnArgument(1);
if ($result) {
$config->expects($this->once())