diff options
Diffstat (limited to 'tests/lib/Files/PathVerificationTest.php')
-rw-r--r-- | tests/lib/Files/PathVerificationTest.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/lib/Files/PathVerificationTest.php b/tests/lib/Files/PathVerificationTest.php index d6dff445c0f..8e4dfd1bb1e 100644 --- a/tests/lib/Files/PathVerificationTest.php +++ b/tests/lib/Files/PathVerificationTest.php @@ -10,6 +10,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 +33,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 +45,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 +62,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 +85,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); |