diff options
author | Joas Schilling <coding@schilljs.com> | 2023-08-16 17:40:38 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-08-23 06:44:08 +0200 |
commit | 759fc11f39839801e75a46ea619508b587448727 (patch) | |
tree | 6299c12f21407af5ac9a043130a397c154bab240 /tests | |
parent | b5dbb4d9f2f0c3b8ccfa16704cdcb7abf231d56e (diff) | |
download | nextcloud-server-759fc11f39839801e75a46ea619508b587448727.tar.gz nextcloud-server-759fc11f39839801e75a46ea619508b587448727.zip |
fix: Make bypass function public API
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Security/Bruteforce/CapabilitiesTest.php | 8 | ||||
-rw-r--r-- | tests/lib/Security/Bruteforce/ThrottlerTest.php | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/lib/Security/Bruteforce/CapabilitiesTest.php b/tests/lib/Security/Bruteforce/CapabilitiesTest.php index d3463d307c0..266acdcb285 100644 --- a/tests/lib/Security/Bruteforce/CapabilitiesTest.php +++ b/tests/lib/Security/Bruteforce/CapabilitiesTest.php @@ -25,8 +25,8 @@ declare(strict_types=1); namespace Test\Security\Bruteforce; use OC\Security\Bruteforce\Capabilities; -use OC\Security\Bruteforce\Throttler; use OCP\IRequest; +use OCP\Security\Bruteforce\IThrottler; use Test\TestCase; class CapabilitiesTest extends TestCase { @@ -36,7 +36,7 @@ class CapabilitiesTest extends TestCase { /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */ private $request; - /** @var Throttler|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IThrottler|\PHPUnit\Framework\MockObject\MockObject */ private $throttler; protected function setUp(): void { @@ -44,7 +44,7 @@ class CapabilitiesTest extends TestCase { $this->request = $this->createMock(IRequest::class); - $this->throttler = $this->createMock(Throttler::class); + $this->throttler = $this->createMock(IThrottler::class); $this->capabilities = new Capabilities( $this->request, @@ -59,7 +59,7 @@ class CapabilitiesTest extends TestCase { ->willReturn(42); $this->throttler->expects($this->atLeastOnce()) - ->method('isIPWhitelisted') + ->method('isBypassListed') ->with('10.10.10.10') ->willReturn(true); diff --git a/tests/lib/Security/Bruteforce/ThrottlerTest.php b/tests/lib/Security/Bruteforce/ThrottlerTest.php index e7fd12645e1..e368a0912b1 100644 --- a/tests/lib/Security/Bruteforce/ThrottlerTest.php +++ b/tests/lib/Security/Bruteforce/ThrottlerTest.php @@ -185,7 +185,7 @@ class ThrottlerTest extends TestCase { $this->assertSame( ($enabled === false) ? true : $isWhiteListed, - self::invokePrivate($this->throttler, 'isIPWhitelisted', [$ip]) + self::invokePrivate($this->throttler, 'isBypassListed', [$ip]) ); } |