Skip to content

Commit 0f4bace

Browse files
committed
fixup! Add notification for user limit
1 parent 2260c02 commit 0f4bace

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/lib/Support/Subscription/RegistryTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
use OC\Support\Subscription\Registry;
2626
use OCP\IConfig;
27+
use OCP\IGroup;
2728
use OCP\IGroupManager;
2829
use OCP\IServerContainer;
2930
use OCP\IUserManager;
@@ -165,6 +166,13 @@ public function testDelegateIsHardUserLimitReached() {
165166
->method('isHardUserLimitReached')
166167
->willReturn(true);
167168
$this->registry->register($subscription);
169+
$dummyGroup = $this->createMock(IGroup::class);
170+
$dummyGroup->expects($this->once())
171+
->method('getUsers')
172+
->willReturn([]);
173+
$this->groupManager->expects($this->once())
174+
->method('get')
175+
->willReturn($dummyGroup);
168176

169177
$this->assertSame(true, $this->registry->delegateIsHardUserLimitReached());
170178
}
@@ -216,6 +224,16 @@ public function testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount(
216224
->method('getBackends')
217225
->willReturn([$dummyBackend]);
218226

227+
if ($expectedResult) {
228+
$dummyGroup = $this->createMock(IGroup::class);
229+
$dummyGroup->expects($this->once())
230+
->method('getUsers')
231+
->willReturn([]);
232+
$this->groupManager->expects($this->once())
233+
->method('get')
234+
->willReturn($dummyGroup);
235+
}
236+
219237
$this->assertSame($expectedResult, $this->registry->delegateIsHardUserLimitReached());
220238
}
221239
}

0 commit comments

Comments
 (0)