aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests/Controller
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 /apps/files/tests/Controller
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 'apps/files/tests/Controller')
-rw-r--r--apps/files/tests/Controller/ApiControllerTest.php6
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php4
2 files changed, 4 insertions, 6 deletions
diff --git a/apps/files/tests/Controller/ApiControllerTest.php b/apps/files/tests/Controller/ApiControllerTest.php
index d6d86e293fd..e74989eb2f5 100644
--- a/apps/files/tests/Controller/ApiControllerTest.php
+++ b/apps/files/tests/Controller/ApiControllerTest.php
@@ -119,7 +119,7 @@ class ApiControllerTest extends TestCase {
$this->tagService->expects($this->once())
->method('updateFileTags')
->with('/path.txt', ['Tag1', 'Tag2'])
- ->will($this->throwException(new NotFoundException('My error message')));
+ ->willThrowException(new NotFoundException('My error message'));
$expected = new DataResponse(['message' => 'My error message'], Http::STATUS_NOT_FOUND);
$this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt', ['Tag1', 'Tag2']));
@@ -129,7 +129,7 @@ class ApiControllerTest extends TestCase {
$this->tagService->expects($this->once())
->method('updateFileTags')
->with('/path.txt', ['Tag1', 'Tag2'])
- ->will($this->throwException(new StorageNotAvailableException('My error message')));
+ ->willThrowException(new StorageNotAvailableException('My error message'));
$expected = new DataResponse(['message' => 'My error message'], Http::STATUS_SERVICE_UNAVAILABLE);
$this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt', ['Tag1', 'Tag2']));
@@ -139,7 +139,7 @@ class ApiControllerTest extends TestCase {
$this->tagService->expects($this->once())
->method('updateFileTags')
->with('/path.txt', ['Tag1', 'Tag2'])
- ->will($this->throwException(new \Exception('My error message')));
+ ->willThrowException(new \Exception('My error message'));
$expected = new DataResponse(['message' => 'My error message'], Http::STATUS_NOT_FOUND);
$this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt', ['Tag1', 'Tag2']));
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index 93ef98bdec7..a9a80fc6f35 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -210,9 +210,7 @@ class ViewControllerTest extends TestCase {
];
}
- /**
- * @dataProvider dataTestShortRedirect
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestShortRedirect')]
public function testShortRedirect(?string $openfile, ?string $opendetails, string $result): void {
$this->appManager->expects($this->any())
->method('isEnabledForUser')