diff options
Diffstat (limited to 'tests/lib/Http')
-rw-r--r-- | tests/lib/Http/Client/ClientServiceTest.php | 12 | ||||
-rw-r--r-- | tests/lib/Http/Client/ClientTest.php | 26 | ||||
-rw-r--r-- | tests/lib/Http/Client/DnsPinMiddlewareTest.php | 10 |
3 files changed, 24 insertions, 24 deletions
diff --git a/tests/lib/Http/Client/ClientServiceTest.php b/tests/lib/Http/Client/ClientServiceTest.php index 7c9cd55a6cc..fd5b155ca69 100644 --- a/tests/lib/Http/Client/ClientServiceTest.php +++ b/tests/lib/Http/Client/ClientServiceTest.php @@ -40,7 +40,7 @@ class ClientServiceTest extends \Test\TestCase { $dnsPinMiddleware ->expects($this->atLeastOnce()) ->method('addDnsPinning') - ->willReturn(function () { + ->willReturn(function (): void { }); $remoteHostValidator = $this->createMock(IRemoteHostValidator::class); $eventLogger = $this->createMock(IEventLogger::class); @@ -58,9 +58,9 @@ class ClientServiceTest extends \Test\TestCase { $handler = new CurlHandler(); $stack = HandlerStack::create($handler); $stack->push($dnsPinMiddleware->addDnsPinning()); - $stack->push(Middleware::tap(function (RequestInterface $request) use ($eventLogger) { + $stack->push(Middleware::tap(function (RequestInterface $request) use ($eventLogger): void { $eventLogger->start('http:request', $request->getMethod() . ' request to ' . $request->getRequestTarget()); - }, function () use ($eventLogger) { + }, function () use ($eventLogger): void { $eventLogger->end('http:request'); }), 'event logger'); $guzzleClient = new GuzzleClient(['handler' => $stack]); @@ -89,7 +89,7 @@ class ClientServiceTest extends \Test\TestCase { $dnsPinMiddleware ->expects($this->never()) ->method('addDnsPinning') - ->willReturn(function () { + ->willReturn(function (): void { }); $remoteHostValidator = $this->createMock(IRemoteHostValidator::class); $eventLogger = $this->createMock(IEventLogger::class); @@ -106,9 +106,9 @@ class ClientServiceTest extends \Test\TestCase { $handler = new CurlHandler(); $stack = HandlerStack::create($handler); - $stack->push(Middleware::tap(function (RequestInterface $request) use ($eventLogger) { + $stack->push(Middleware::tap(function (RequestInterface $request) use ($eventLogger): void { $eventLogger->start('http:request', $request->getMethod() . ' request to ' . $request->getRequestTarget()); - }, function () use ($eventLogger) { + }, function () use ($eventLogger): void { $eventLogger->end('http:request'); }), 'event logger'); $guzzleClient = new GuzzleClient(['handler' => $stack]); diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php index 92e5f04d7f0..2c0f982c51c 100644 --- a/tests/lib/Http/Client/ClientTest.php +++ b/tests/lib/Http/Client/ClientTest.php @@ -66,16 +66,16 @@ class ClientTest extends \Test\TestCase { public function testGetProxyUriProxyHostEmptyPassword(): void { $this->config ->method('getSystemValue') - ->will($this->returnValueMap([ + ->willReturnMap([ ['proxyexclude', [], []], - ])); + ]); $this->config ->method('getSystemValueString') - ->will($this->returnValueMap([ + ->willReturnMap([ ['proxy', '', 'foo'], ['proxyuserpwd', '', ''], - ])); + ]); $this->assertEquals([ 'http' => 'foo', @@ -254,21 +254,21 @@ class ClientTest extends \Test\TestCase { private function setUpDefaultRequestOptions(): void { $this->config ->method('getSystemValue') - ->will($this->returnValueMap([ + ->willReturnMap([ ['proxyexclude', [], []], - ])); + ]); $this->config ->method('getSystemValueString') - ->will($this->returnValueMap([ + ->willReturnMap([ ['proxy', '', 'foo'], ['proxyuserpwd', '', ''], - ])); + ]); $this->config ->method('getSystemValueBool') - ->will($this->returnValueMap([ + ->willReturnMap([ ['installed', false, true], ['allow_local_remote_servers', false, true], - ])); + ]); $this->certificateManager ->expects($this->once()) @@ -481,7 +481,7 @@ class ClientTest extends \Test\TestCase { \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, \Psr\Http\Message\UriInterface $uri, - ) { + ): void { }, ], ], self::invokePrivate($this->client, 'buildRequestOptions', [[]])); @@ -532,7 +532,7 @@ class ClientTest extends \Test\TestCase { \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, \Psr\Http\Message\UriInterface $uri, - ) { + ): void { }, ], ], self::invokePrivate($this->client, 'buildRequestOptions', [[]])); @@ -584,7 +584,7 @@ class ClientTest extends \Test\TestCase { \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, \Psr\Http\Message\UriInterface $uri, - ) { + ): void { }, ], ], self::invokePrivate($this->client, 'buildRequestOptions', [[]])); diff --git a/tests/lib/Http/Client/DnsPinMiddlewareTest.php b/tests/lib/Http/Client/DnsPinMiddlewareTest.php index 88059d44121..9c0aa198cd8 100644 --- a/tests/lib/Http/Client/DnsPinMiddlewareTest.php +++ b/tests/lib/Http/Client/DnsPinMiddlewareTest.php @@ -273,7 +273,7 @@ class DnsPinMiddlewareTest extends TestCase { $this->expectExceptionMessage('violates local access rules'); $mockHandler = new MockHandler([ - static function (RequestInterface $request, array $options) { + static function (RequestInterface $request, array $options): void { // The handler should not be called }, ]); @@ -320,7 +320,7 @@ class DnsPinMiddlewareTest extends TestCase { $this->expectExceptionMessage('violates local access rules'); $mockHandler = new MockHandler([ - static function (RequestInterface $request, array $options) { + static function (RequestInterface $request, array $options): void { // The handler should not be called }, ]); @@ -367,7 +367,7 @@ class DnsPinMiddlewareTest extends TestCase { $this->expectExceptionMessage('violates local access rules'); $mockHandler = new MockHandler([ - static function (RequestInterface $request, array $options) { + static function (RequestInterface $request, array $options): void { // The handler should not be called }, ]); @@ -457,7 +457,7 @@ class DnsPinMiddlewareTest extends TestCase { $this->expectExceptionMessage('No DNS record found for www.example.com'); $mockHandler = new MockHandler([ - static function (RequestInterface $request, array $options) { + static function (RequestInterface $request, array $options): void { // The handler should not be called }, ]); @@ -480,7 +480,7 @@ class DnsPinMiddlewareTest extends TestCase { public function testIgnoreSubdomainForSoaQuery(): void { $mockHandler = new MockHandler([ - static function (RequestInterface $request, array $options) { + static function (RequestInterface $request, array $options): void { // The handler should not be called }, ]); |