aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/tests/Controller')
-rw-r--r--apps/files_external/tests/Controller/GlobalStoragesControllerTest.php1
-rw-r--r--apps/files_external/tests/Controller/StoragesControllerTestCase.php14
2 files changed, 6 insertions, 9 deletions
diff --git a/apps/files_external/tests/Controller/GlobalStoragesControllerTest.php b/apps/files_external/tests/Controller/GlobalStoragesControllerTest.php
index 2edc3ea3efc..74a27eb15e4 100644
--- a/apps/files_external/tests/Controller/GlobalStoragesControllerTest.php
+++ b/apps/files_external/tests/Controller/GlobalStoragesControllerTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
diff --git a/apps/files_external/tests/Controller/StoragesControllerTestCase.php b/apps/files_external/tests/Controller/StoragesControllerTestCase.php
index bb29904ab0d..1eb52f9b459 100644
--- a/apps/files_external/tests/Controller/StoragesControllerTestCase.php
+++ b/apps/files_external/tests/Controller/StoragesControllerTestCase.php
@@ -186,9 +186,7 @@ abstract class StoragesControllerTestCase extends \Test\TestCase {
];
}
- /**
- * @dataProvider mountPointNamesProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('mountPointNamesProvider')]
public function testAddOrUpdateStorageInvalidMountPoint($mountPoint): void {
$storageConfig = new StorageConfig(1);
$storageConfig->setMountPoint($mountPoint);
@@ -235,7 +233,7 @@ abstract class StoragesControllerTestCase extends \Test\TestCase {
public function testAddOrUpdateStorageInvalidBackend(): void {
$this->service->expects($this->exactly(2))
->method('createStorage')
- ->will($this->throwException(new \InvalidArgumentException()));
+ ->willThrowException(new \InvalidArgumentException());
$this->service->expects($this->never())
->method('addStorage');
$this->service->expects($this->never())
@@ -292,7 +290,7 @@ abstract class StoragesControllerTestCase extends \Test\TestCase {
->willReturn($storageConfig);
$this->service->expects($this->once())
->method('updateStorage')
- ->will($this->throwException(new NotFoundException()));
+ ->willThrowException(new NotFoundException());
$response = $this->controller->update(
255,
@@ -320,7 +318,7 @@ abstract class StoragesControllerTestCase extends \Test\TestCase {
public function testDeleteStorageNonExisting(): void {
$this->service->expects($this->once())
->method('removeStorage')
- ->will($this->throwException(new NotFoundException()));
+ ->willThrowException(new NotFoundException());
$response = $this->controller->destroy(255);
$this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus());
@@ -357,9 +355,7 @@ abstract class StoragesControllerTestCase extends \Test\TestCase {
];
}
- /**
- * @dataProvider validateStorageProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('validateStorageProvider')]
public function testValidateStorage(bool $backendValidate, bool $authMechValidate, bool $expectSuccess): void {
$backend = $this->getBackendMock();
$backend->method('validateStorage')