From 759fc11f39839801e75a46ea619508b587448727 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 16 Aug 2023 17:40:38 +0200 Subject: fix: Make bypass function public API Signed-off-by: Joas Schilling --- tests/lib/Security/Bruteforce/CapabilitiesTest.php | 8 ++++---- tests/lib/Security/Bruteforce/ThrottlerTest.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') 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]) ); } -- cgit v1.2.3