aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/PathVerificationTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Files/PathVerificationTest.php')
-rw-r--r--tests/lib/Files/PathVerificationTest.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/lib/Files/PathVerificationTest.php b/tests/lib/Files/PathVerificationTest.php
index d6dff445c0f..75f8302d89c 100644
--- a/tests/lib/Files/PathVerificationTest.php
+++ b/tests/lib/Files/PathVerificationTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -10,6 +11,8 @@ namespace Test\Files;
use OC\Files\Storage\Local;
use OC\Files\View;
use OCP\Files\InvalidPathException;
+use OCP\IDBConnection;
+use OCP\Server;
/**
* Class PathVerificationTest
@@ -31,7 +34,7 @@ class PathVerificationTest extends \Test\TestCase {
public function testPathVerificationFileNameTooLong(): void {
- $this->expectException(\OCP\Files\InvalidPathException::class);
+ $this->expectException(InvalidPathException::class);
$this->expectExceptionMessage('Filename is too long');
$fileName = str_repeat('a', 500);
@@ -43,7 +46,7 @@ class PathVerificationTest extends \Test\TestCase {
* @dataProvider providesEmptyFiles
*/
public function testPathVerificationEmptyFileName($fileName): void {
- $this->expectException(\OCP\Files\InvalidPathException::class);
+ $this->expectException(InvalidPathException::class);
$this->expectExceptionMessage('Empty filename is not allowed');
$this->view->verifyPath('', $fileName);
@@ -60,7 +63,7 @@ class PathVerificationTest extends \Test\TestCase {
* @dataProvider providesDotFiles
*/
public function testPathVerificationDotFiles($fileName): void {
- $this->expectException(\OCP\Files\InvalidPathException::class);
+ $this->expectException(InvalidPathException::class);
$this->expectExceptionMessage('Dot files are not allowed');
$this->view->verifyPath('', $fileName);
@@ -83,7 +86,7 @@ class PathVerificationTest extends \Test\TestCase {
* @dataProvider providesAstralPlane
*/
public function testPathVerificationAstralPlane($fileName): void {
- $connection = \OC::$server->getDatabaseConnection();
+ $connection = Server::get(IDBConnection::class);
if (!$connection->supports4ByteText()) {
$this->expectException(InvalidPathException::class);