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:
authorJoas Schilling <coding@schilljs.com>2022-08-19 00:52:34 +0300
committerJoas Schilling <coding@schilljs.com>2022-08-19 11:48:32 +0300
commit7e1177819023a185480b5251e3a22dc429948518 (patch)
tree66288b17692cfcdde3e3273051e00224b4167b1f /apps/dav/tests
parentcab0f1327e28104ef61e8767f963d20cf38544af (diff)
Use user name cache in activity providers
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php37
1 files changed, 0 insertions, 37 deletions
diff --git a/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php b/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php
index 21cafee4f88..9e1e02189f5 100644
--- a/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php
+++ b/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php
@@ -160,41 +160,4 @@ class BaseTest extends TestCase {
'name' => $gid,
], $this->invokePrivate($this->provider, 'generateGroupParameter', [$gid]));
}
-
- public function dataGenerateUserParameter() {
- $u1 = $this->createMock(IUser::class);
- $u1->expects($this->any())
- ->method('getDisplayName')
- ->willReturn('User 1');
- return [
- ['u1', 'User 1', $u1],
- ['u2', 'u2', null],
- ];
- }
-
- /**
- * @dataProvider dataGenerateUserParameter
- * @param string $uid
- * @param string $displayName
- * @param IUser|null $user
- */
- public function testGenerateUserParameter(string $uid, string $displayName, ?IUser $user) {
- $this->userManager->expects($this->once())
- ->method('get')
- ->with($uid)
- ->willReturn($user);
-
- $this->assertEquals([
- 'type' => 'user',
- 'id' => $uid,
- 'name' => $displayName,
- ], $this->invokePrivate($this->provider, 'generateUserParameter', [$uid]));
-
- // Test caching (only 1 user manager invocation allowed)
- $this->assertEquals([
- 'type' => 'user',
- 'id' => $uid,
- 'name' => $displayName,
- ], $this->invokePrivate($this->provider, 'generateUserParameter', [$uid]));
- }
}