aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-08-17 08:45:46 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-21 16:40:24 +0200
commitbed3ffb3124ac9d4ab83ce21460356b00eeca82e (patch)
tree6f27f4f533e63892575f7297588b35196b306e17 /apps/settings/tests
parent124588d4a64f518aef9270002e72c3604ddb3077 (diff)
downloadnextcloud-server-bed3ffb3124ac9d4ab83ce21460356b00eeca82e.tar.gz
nextcloud-server-bed3ffb3124ac9d4ab83ce21460356b00eeca82e.zip
feat(admin): Show an error when the admin is throttled
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/settings/tests')
-rw-r--r--apps/settings/tests/Controller/CheckSetupControllerTest.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php
index 564c1cbb62d..d4af6bd603c 100644
--- a/apps/settings/tests/Controller/CheckSetupControllerTest.php
+++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php
@@ -59,6 +59,7 @@ use OCP\ITempManager;
use OCP\IURLGenerator;
use OCP\Lock\ILockingProvider;
use OCP\Notification\IManager;
+use OCP\Security\Bruteforce\IThrottler;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
@@ -143,6 +144,7 @@ class CheckSetupControllerTest extends TestCase {
$this->logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
$this->db = $this->getMockBuilder(Connection::class)
->disableOriginalConstructor()->getMock();
+ $this->throttler = $this->createMock(IThrottler::class);
$this->lockingProvider = $this->getMockBuilder(ILockingProvider::class)->getMock();
$this->dateTimeFormatter = $this->getMockBuilder(IDateTimeFormatter::class)->getMock();
$this->memoryInfo = $this->getMockBuilder(MemoryInfo::class)
@@ -174,6 +176,7 @@ class CheckSetupControllerTest extends TestCase {
$this->secureRandom,
$this->iniGetWrapper,
$this->connection,
+ $this->throttler,
$this->tempManager,
$this->notificationManager,
$this->appManager,
@@ -659,6 +662,8 @@ class CheckSetupControllerTest extends TestCase {
'isFairUseOfFreePushService' => false,
'temporaryDirectoryWritable' => false,
\OCA\Settings\SetupChecks\LdapInvalidUuids::class => ['pass' => true, 'description' => 'Invalid UUIDs of LDAP users or groups have been found. Please review your "Override UUID detection" settings in the Expert part of the LDAP configuration and use "occ ldap:update-uuid" to update them.', 'severity' => 'warning'],
+ 'isBruteforceThrottled' => false,
+ 'bruteforceRemoteAddress' => '',
]
);
$this->assertEquals($expected, $this->checkSetupController->check());
@@ -683,6 +688,7 @@ class CheckSetupControllerTest extends TestCase {
$this->secureRandom,
$this->iniGetWrapper,
$this->connection,
+ $this->throttler,
$this->tempManager,
$this->notificationManager,
$this->appManager,
@@ -1410,6 +1416,7 @@ Array
$this->secureRandom,
$this->iniGetWrapper,
$this->connection,
+ $this->throttler,
$this->tempManager,
$this->notificationManager,
$this->appManager,
@@ -1464,6 +1471,7 @@ Array
$this->secureRandom,
$this->iniGetWrapper,
$this->connection,
+ $this->throttler,
$this->tempManager,
$this->notificationManager,
$this->appManager,