aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Http
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-06-30 16:56:59 +0200
committerRobin Appelman <robin@icewind.nl>2025-07-01 22:45:52 +0200
commitaa15f9d16d5b46d04763c7deedb129990e819364 (patch)
tree758e0aebcac34a545f9a21806120a9fcb96f4cb6 /tests/lib/AppFramework/Http
parent1620a0c0510a42b1da0a66488838f1ce3ba1210d (diff)
downloadnextcloud-server-rector-phpunit10.tar.gz
nextcloud-server-rector-phpunit10.zip
chore: run rectorrector-phpunit10
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/AppFramework/Http')
-rw-r--r--tests/lib/AppFramework/Http/DispatcherTest.php6
-rw-r--r--tests/lib/AppFramework/Http/DownloadResponseTest.php4
-rw-r--r--tests/lib/AppFramework/Http/JSONResponseTest.php2
-rw-r--r--tests/lib/AppFramework/Http/RequestTest.php36
-rw-r--r--tests/lib/AppFramework/Http/ResponseTest.php2
-rw-r--r--tests/lib/AppFramework/Http/TemplateResponseTest.php2
6 files changed, 19 insertions, 33 deletions
diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php
index 4ed6627891c..86c78e840e0 100644
--- a/tests/lib/AppFramework/Http/DispatcherTest.php
+++ b/tests/lib/AppFramework/Http/DispatcherTest.php
@@ -32,7 +32,7 @@ use Psr\Log\LoggerInterface;
class TestController extends Controller {
/**
* @param string $appName
- * @param \OCP\IRequest $request
+ * @param IRequest $request
*/
public function __construct($appName, $request) {
parent::__construct($appName, $request);
@@ -547,9 +547,7 @@ class DispatcherTest extends \Test\TestCase {
];
}
- /**
- * @dataProvider rangeDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('rangeDataProvider')]
public function testEnsureParameterValueSatisfiesRange(int $min, int $max, int $input, bool $throw): void {
$this->reflector = $this->createMock(ControllerMethodReflector::class);
$this->reflector->expects($this->any())
diff --git a/tests/lib/AppFramework/Http/DownloadResponseTest.php b/tests/lib/AppFramework/Http/DownloadResponseTest.php
index cf179ba270b..b2f60edd999 100644
--- a/tests/lib/AppFramework/Http/DownloadResponseTest.php
+++ b/tests/lib/AppFramework/Http/DownloadResponseTest.php
@@ -27,9 +27,7 @@ class DownloadResponseTest extends \Test\TestCase {
$this->assertEquals('content', $headers['Content-Type']);
}
- /**
- * @dataProvider filenameEncodingProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('filenameEncodingProvider')]
public function testFilenameEncoding(string $input, string $expected): void {
$response = new ChildDownloadResponse($input, 'content');
$headers = $response->getHeaders();
diff --git a/tests/lib/AppFramework/Http/JSONResponseTest.php b/tests/lib/AppFramework/Http/JSONResponseTest.php
index 703e6d89dd1..56f67b23f0d 100644
--- a/tests/lib/AppFramework/Http/JSONResponseTest.php
+++ b/tests/lib/AppFramework/Http/JSONResponseTest.php
@@ -58,10 +58,10 @@ class JSONResponseTest extends \Test\TestCase {
}
/**
- * @dataProvider renderDataProvider
* @param array $input
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('renderDataProvider')]
public function testRender(array $input, $expected): void {
$this->json->setData($input);
$this->assertEquals($expected, $this->json->render());
diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php
index 7107131e031..a7ff123fc25 100644
--- a/tests/lib/AppFramework/Http/RequestTest.php
+++ b/tests/lib/AppFramework/Http/RequestTest.php
@@ -260,9 +260,7 @@ class RequestTest extends \Test\TestCase {
];
}
- /**
- * @dataProvider dataNotJsonData
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataNotJsonData')]
public function testNotJsonPost(string $testData): void {
global $data;
$data = $testData;
@@ -709,9 +707,7 @@ class RequestTest extends \Test\TestCase {
];
}
- /**
- * @dataProvider dataGetRemoteAddress
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetRemoteAddress')]
public function testGetRemoteAddress(array $headers, array $trustedProxies, array $forwardedForHeaders, string $expected): void {
$this->config
->method('getSystemValue')
@@ -760,11 +756,11 @@ class RequestTest extends \Test\TestCase {
}
/**
- * @dataProvider dataHttpProtocol
*
* @param mixed $input
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataHttpProtocol')]
public function testGetHttpProtocol($input, $expected): void {
$request = new Request(
[
@@ -950,11 +946,11 @@ class RequestTest extends \Test\TestCase {
}
/**
- * @dataProvider dataUserAgent
* @param string $testAgent
* @param array $userAgent
* @param bool $matches
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataUserAgent')]
public function testUserAgent($testAgent, $userAgent, $matches): void {
$request = new Request(
[
@@ -972,11 +968,11 @@ class RequestTest extends \Test\TestCase {
}
/**
- * @dataProvider dataUserAgent
* @param string $testAgent
* @param array $userAgent
* @param bool $matches
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataUserAgent')]
public function testUndefinedUserAgent($testAgent, $userAgent, $matches): void {
$request = new Request(
[],
@@ -1154,11 +1150,11 @@ class RequestTest extends \Test\TestCase {
}
/**
- * @dataProvider dataMatchClientVersion
* @param string $testAgent
* @param string $userAgent
* @param string $version
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataMatchClientVersion')]
public function testMatchClientVersion(string $testAgent, string $userAgent, string $version): void {
preg_match($userAgent, $testAgent, $matches);
@@ -1373,9 +1369,7 @@ class RequestTest extends \Test\TestCase {
];
}
- /**
- * @dataProvider dataGetServerHostTrustedDomain
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetServerHostTrustedDomain')]
public function testGetServerHostTrustedDomain(string $expected, $trustedDomain): void {
$this->config
->method('getSystemValue')
@@ -1485,11 +1479,11 @@ class RequestTest extends \Test\TestCase {
}
/**
- * @dataProvider dataGenericPathInfo
* @param string $requestUri
* @param string $scriptName
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGenericPathInfo')]
public function testGetPathInfoWithoutSetEnvGeneric($requestUri, $scriptName, $expected): void {
$request = new Request(
[
@@ -1508,11 +1502,11 @@ class RequestTest extends \Test\TestCase {
}
/**
- * @dataProvider dataGenericPathInfo
* @param string $requestUri
* @param string $scriptName
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGenericPathInfo')]
public function testGetRawPathInfoWithoutSetEnvGeneric($requestUri, $scriptName, $expected): void {
$request = new Request(
[
@@ -1531,11 +1525,11 @@ class RequestTest extends \Test\TestCase {
}
/**
- * @dataProvider dataRawPathInfo
* @param string $requestUri
* @param string $scriptName
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataRawPathInfo')]
public function testGetRawPathInfoWithoutSetEnv($requestUri, $scriptName, $expected): void {
$request = new Request(
[
@@ -1554,11 +1548,11 @@ class RequestTest extends \Test\TestCase {
}
/**
- * @dataProvider dataPathInfo
* @param string $requestUri
* @param string $scriptName
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataPathInfo')]
public function testGetPathInfoWithoutSetEnv($requestUri, $scriptName, $expected): void {
$request = new Request(
[
@@ -1629,9 +1623,7 @@ class RequestTest extends \Test\TestCase {
];
}
- /**
- * @dataProvider dataGetRequestUriWithOverwrite
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetRequestUriWithOverwrite')]
public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot, $overwriteCondAddr, $remoteAddr = ''): void {
$this->config
->expects($this->exactly(2))
@@ -2184,9 +2176,7 @@ class RequestTest extends \Test\TestCase {
];
}
- /**
- * @dataProvider dataInvalidToken
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataInvalidToken')]
public function testPassesCSRFCheckWithInvalidToken(string $invalidToken): void {
/** @var Request $request */
$request = $this->getMockBuilder(Request::class)
diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php
index 7750db921c6..4c76695f6e4 100644
--- a/tests/lib/AppFramework/Http/ResponseTest.php
+++ b/tests/lib/AppFramework/Http/ResponseTest.php
@@ -16,7 +16,7 @@ use OCP\AppFramework\Utility\ITimeFactory;
class ResponseTest extends \Test\TestCase {
/**
- * @var \OCP\AppFramework\Http\Response
+ * @var Response
*/
private $childResponse;
diff --git a/tests/lib/AppFramework/Http/TemplateResponseTest.php b/tests/lib/AppFramework/Http/TemplateResponseTest.php
index ad0fe808b76..28f952e35e3 100644
--- a/tests/lib/AppFramework/Http/TemplateResponseTest.php
+++ b/tests/lib/AppFramework/Http/TemplateResponseTest.php
@@ -13,7 +13,7 @@ use OCP\AppFramework\Http\TemplateResponse;
class TemplateResponseTest extends \Test\TestCase {
/**
- * @var \OCP\AppFramework\Http\TemplateResponse
+ * @var TemplateResponse
*/
private $tpl;