diff options
Diffstat (limited to 'apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php')
-rw-r--r-- | apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php index 1d50fb2fb9a..416ac8a75c9 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -11,21 +12,16 @@ use OC\SystemConfig; use OCA\DAV\Connector\Sabre\Exception\InvalidPath; use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin; use OCA\DAV\Exception\ServerMaintenanceMode; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\Server; use Test\TestCase; class ExceptionLoggerPluginTest extends TestCase { - - /** @var Server */ - private $server; - - /** @var ExceptionLoggerPlugin */ - private $plugin; - - /** @var LoggerInterface | \PHPUnit\Framework\MockObject\MockObject */ - private $logger; + private Server $server; + private ExceptionLoggerPlugin $plugin; + private LoggerInterface&MockObject $logger; private function init(): void { $config = $this->createMock(SystemConfig::class); @@ -46,9 +42,7 @@ class ExceptionLoggerPluginTest extends TestCase { $this->plugin->initialize($this->server); } - /** - * @dataProvider providesExceptions - */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesExceptions')] public function testLogging(string $expectedLogLevel, \Throwable $e): void { $this->init(); @@ -59,7 +53,7 @@ class ExceptionLoggerPluginTest extends TestCase { $this->plugin->logException($e); } - public function providesExceptions() { + public static function providesExceptions(): array { return [ ['debug', new NotFound()], ['debug', new ServerMaintenanceMode('System is in maintenance mode.')], |