aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Http/Client/ClientTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Http/Client/ClientTest.php')
-rw-r--r--tests/lib/Http/Client/ClientTest.php40
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php
index 92e5f04d7f0..e76b66b52d7 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',
@@ -151,9 +151,9 @@ class ClientTest extends \Test\TestCase {
}
/**
- * @dataProvider dataPreventLocalAddress
* @param string $uri
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataPreventLocalAddress')]
public function testPreventLocalAddressDisabledByGlobalConfig(string $uri): void {
$this->config->expects($this->once())
->method('getSystemValueBool')
@@ -164,9 +164,9 @@ class ClientTest extends \Test\TestCase {
}
/**
- * @dataProvider dataPreventLocalAddress
* @param string $uri
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataPreventLocalAddress')]
public function testPreventLocalAddressDisabledByOption(string $uri): void {
$this->config->expects($this->never())
->method('getSystemValueBool');
@@ -177,9 +177,9 @@ class ClientTest extends \Test\TestCase {
}
/**
- * @dataProvider dataPreventLocalAddress
* @param string $uri
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataPreventLocalAddress')]
public function testPreventLocalAddressOnGet(string $uri): void {
$host = parse_url($uri, PHP_URL_HOST);
$this->expectException(LocalServerException::class);
@@ -192,9 +192,9 @@ class ClientTest extends \Test\TestCase {
}
/**
- * @dataProvider dataPreventLocalAddress
* @param string $uri
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataPreventLocalAddress')]
public function testPreventLocalAddressOnHead(string $uri): void {
$host = parse_url($uri, PHP_URL_HOST);
$this->expectException(LocalServerException::class);
@@ -207,9 +207,9 @@ class ClientTest extends \Test\TestCase {
}
/**
- * @dataProvider dataPreventLocalAddress
* @param string $uri
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataPreventLocalAddress')]
public function testPreventLocalAddressOnPost(string $uri): void {
$host = parse_url($uri, PHP_URL_HOST);
$this->expectException(LocalServerException::class);
@@ -222,9 +222,9 @@ class ClientTest extends \Test\TestCase {
}
/**
- * @dataProvider dataPreventLocalAddress
* @param string $uri
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataPreventLocalAddress')]
public function testPreventLocalAddressOnPut(string $uri): void {
$host = parse_url($uri, PHP_URL_HOST);
$this->expectException(LocalServerException::class);
@@ -237,9 +237,9 @@ class ClientTest extends \Test\TestCase {
}
/**
- * @dataProvider dataPreventLocalAddress
* @param string $uri
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataPreventLocalAddress')]
public function testPreventLocalAddressOnDelete(string $uri): void {
$host = parse_url($uri, PHP_URL_HOST);
$this->expectException(LocalServerException::class);
@@ -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', [[]]));