aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-02-03 15:29:47 +0100
committerJoas Schilling <coding@schilljs.com>2023-02-03 16:11:17 +0100
commiteb76fbe8d66d912eb4c39b6aeeb9f42cd7f4a009 (patch)
tree9c5813a92ef64c4afd7fd9763e2c4ffb6e8ab53a /apps
parent6761b94f4ff8bc97fed40284765c73c4eb1168cd (diff)
downloadnextcloud-server-eb76fbe8d66d912eb4c39b6aeeb9f42cd7f4a009.tar.gz
nextcloud-server-eb76fbe8d66d912eb4c39b6aeeb9f42cd7f4a009.zip
fix(CI): Fix unmockable countUsers() method
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/updatenotification/tests/Settings/AdminTest.php35
1 files changed, 21 insertions, 14 deletions
diff --git a/apps/updatenotification/tests/Settings/AdminTest.php b/apps/updatenotification/tests/Settings/AdminTest.php
index 852504fb45a..15b5b2b450a 100644
--- a/apps/updatenotification/tests/Settings/AdminTest.php
+++ b/apps/updatenotification/tests/Settings/AdminTest.php
@@ -29,6 +29,7 @@ declare(strict_types=1);
*/
namespace OCA\UpdateNotification\Tests\Settings;
+use OC\User\Backend;
use OCA\UpdateNotification\Settings\Admin;
use OCA\UpdateNotification\UpdateChecker;
use OCP\AppFramework\Http\TemplateResponse;
@@ -39,6 +40,8 @@ use OCP\IGroupManager;
use OCP\L10N\IFactory;
use OCP\L10N\ILanguageIterator;
use OCP\Support\Subscription\IRegistry;
+use OCP\User\Backend\ICountUsersBackend;
+use OCP\UserInterface;
use OCP\Util;
use Test\TestCase;
use OCP\IUserManager;
@@ -77,11 +80,11 @@ class AdminTest extends TestCase {
$this->logger = $this->createMock(LoggerInterface::class);
$this->admin = new Admin(
- $this->config,
- $this->updateChecker,
- $this->groupManager,
- $this->dateTimeFormatter,
- $this->l10nFactory,
+ $this->config,
+ $this->updateChecker,
+ $this->groupManager,
+ $this->dateTimeFormatter,
+ $this->l10nFactory,
$this->subscriptionRegistry,
$this->userManager,
$this->logger
@@ -89,9 +92,9 @@ class AdminTest extends TestCase {
}
public function testGetFormWithUpdate() {
- $backend1 = $this->createMock(UserInterface::class);
- $backend2 = $this->createMock(UserInterface::class);
- $backend3 = $this->createMock(UserInterface::class);
+ $backend1 = $this->createMock(CountUsersBackend::class);
+ $backend2 = $this->createMock(CountUsersBackend::class);
+ $backend3 = $this->createMock(CountUsersBackend::class);
$backend1
->expects($this->once())
->method('implementsActions')
@@ -213,9 +216,9 @@ class AdminTest extends TestCase {
}
public function testGetFormWithUpdateAndChangedUpdateServer() {
- $backend1 = $this->createMock(UserInterface::class);
- $backend2 = $this->createMock(UserInterface::class);
- $backend3 = $this->createMock(UserInterface::class);
+ $backend1 = $this->createMock(CountUsersBackend::class);
+ $backend2 = $this->createMock(CountUsersBackend::class);
+ $backend3 = $this->createMock(CountUsersBackend::class);
$backend1
->expects($this->once())
->method('implementsActions')
@@ -337,9 +340,9 @@ class AdminTest extends TestCase {
}
public function testGetFormWithUpdateAndCustomersUpdateServer() {
- $backend1 = $this->createMock(UserInterface::class);
- $backend2 = $this->createMock(UserInterface::class);
- $backend3 = $this->createMock(UserInterface::class);
+ $backend1 = $this->createMock(CountUsersBackend::class);
+ $backend2 = $this->createMock(CountUsersBackend::class);
+ $backend3 = $this->createMock(CountUsersBackend::class);
$backend1
->expects($this->once())
->method('implementsActions')
@@ -543,3 +546,7 @@ class AdminTest extends TestCase {
$this->assertSame($expectation, $result);
}
}
+
+abstract class CountUsersBackend implements UserInterface, ICountUsersBackend {
+
+}