diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-05-16 11:07:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 11:07:04 +0200 |
commit | 5e02def3f49a56701a3facfb9dc82ef0fff703d5 (patch) | |
tree | c90a9ed99d64e05ec26d7129327038d2892afeb1 /tests | |
parent | 128cd7030ed38801cc4740c797b4adb4d47c2a6d (diff) | |
parent | 3a6bc7aba2625dd4144e25033fabe8b8f42afb42 (diff) | |
download | nextcloud-server-5e02def3f49a56701a3facfb9dc82ef0fff703d5.tar.gz nextcloud-server-5e02def3f49a56701a3facfb9dc82ef0fff703d5.zip |
Merge pull request #38274 from nextcloud/bugfix/noid/reach-max-delay-in-afterController
fix(middleware): Also abort the request when reaching max delay in af…
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php index 388b2fbf534..faf2d24d172 100644 --- a/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php @@ -157,7 +157,7 @@ class BruteForceMiddlewareTest extends TestCase { ->willReturn('127.0.0.1'); $this->throttler ->expects($this->once()) - ->method('sleepDelay') + ->method('sleepDelayOrThrowOnMax') ->with('127.0.0.1', 'login'); $this->throttler ->expects($this->once()) @@ -181,7 +181,7 @@ class BruteForceMiddlewareTest extends TestCase { ->method('getRemoteAddress'); $this->throttler ->expects($this->never()) - ->method('sleepDelay'); + ->method('sleepDelayOrThrowOnMax'); $this->throttler ->expects($this->never()) ->method('registerAttempt'); @@ -209,7 +209,7 @@ class BruteForceMiddlewareTest extends TestCase { ->willReturn('::1'); $this->throttler ->expects($this->once()) - ->method('sleepDelay') + ->method('sleepDelayOrThrowOnMax') ->with('::1', 'single'); $this->throttler ->expects($this->once()) @@ -239,7 +239,7 @@ class BruteForceMiddlewareTest extends TestCase { ->willReturn('::1'); $this->throttler ->expects($this->exactly(2)) - ->method('sleepDelay') + ->method('sleepDelayOrThrowOnMax') ->withConsecutive( ['::1', 'first'], ['::1', 'second'], @@ -275,7 +275,7 @@ class BruteForceMiddlewareTest extends TestCase { ->willReturn('::1'); $this->throttler ->expects($this->once()) - ->method('sleepDelay') + ->method('sleepDelayOrThrowOnMax') ->with('::1', 'second'); $this->throttler ->expects($this->once()) @@ -293,7 +293,7 @@ class BruteForceMiddlewareTest extends TestCase { ->method('getRemoteAddress'); $this->throttler ->expects($this->never()) - ->method('sleepDelay'); + ->method('sleepDelayOrThrowOnMax'); $controller = new TestController('test', $this->request); $this->reflector->reflect($controller, 'testMethodWithoutAnnotation'); @@ -308,7 +308,7 @@ class BruteForceMiddlewareTest extends TestCase { ->method('getRemoteAddress'); $this->throttler ->expects($this->never()) - ->method('sleepDelay'); + ->method('sleepDelayOrThrowOnMax'); $controller = new TestController('test', $this->request); $this->reflector->reflect($controller, 'testMethodWithoutAnnotation'); |