diff options
Diffstat (limited to 'tests/lib/Log')
-rw-r--r-- | tests/lib/Log/LogFactoryTest.php | 15 | ||||
-rw-r--r-- | tests/lib/Log/PsrLoggerAdapterTest.php | 12 |
2 files changed, 11 insertions, 16 deletions
diff --git a/tests/lib/Log/LogFactoryTest.php b/tests/lib/Log/LogFactoryTest.php index a3549ad7145..b1adbd0e823 100644 --- a/tests/lib/Log/LogFactoryTest.php +++ b/tests/lib/Log/LogFactoryTest.php @@ -13,6 +13,7 @@ use OC\Log\LogFactory; use OC\Log\Syslog; use OC\Log\Systemdlog; use OC\SystemConfig; +use OCP\AppFramework\QueryException; use OCP\IServerContainer; use Test\TestCase; @@ -59,9 +60,9 @@ class LogFactoryTest extends TestCase { /** * @param string $type - * @dataProvider fileTypeProvider - * @throws \OCP\AppFramework\QueryException + * @throws QueryException */ + #[\PHPUnit\Framework\Attributes\DataProvider('fileTypeProvider')] public function testFile(string $type): void { $datadir = \OC::$SERVERROOT . '/data'; $defaultLog = $datadir . '/nextcloud.log'; @@ -92,9 +93,9 @@ class LogFactoryTest extends TestCase { } /** - * @dataProvider logFilePathProvider - * @throws \OCP\AppFramework\QueryException + * @throws QueryException */ + #[\PHPUnit\Framework\Attributes\DataProvider('logFilePathProvider')] public function testFileCustomPath($path, $expected): void { $datadir = \OC::$SERVERROOT . '/data'; $defaultLog = $datadir . '/nextcloud.log'; @@ -113,7 +114,7 @@ class LogFactoryTest extends TestCase { } /** - * @throws \OCP\AppFramework\QueryException + * @throws QueryException */ public function testErrorLog(): void { $log = $this->factory->get('errorlog'); @@ -121,7 +122,7 @@ class LogFactoryTest extends TestCase { } /** - * @throws \OCP\AppFramework\QueryException + * @throws QueryException */ public function testSystemLog(): void { $this->c->expects($this->once()) @@ -134,7 +135,7 @@ class LogFactoryTest extends TestCase { } /** - * @throws \OCP\AppFramework\QueryException + * @throws QueryException */ public function testSystemdLog(): void { $this->c->expects($this->once()) diff --git a/tests/lib/Log/PsrLoggerAdapterTest.php b/tests/lib/Log/PsrLoggerAdapterTest.php index 9a159ba537d..c11af7a12c2 100644 --- a/tests/lib/Log/PsrLoggerAdapterTest.php +++ b/tests/lib/Log/PsrLoggerAdapterTest.php @@ -28,9 +28,7 @@ class PsrLoggerAdapterTest extends TestCase { $this->loggerAdapter = new PsrLoggerAdapter($this->logger); } - /** - * @dataProvider dataPsrLoggingLevels - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataPsrLoggingLevels')] public function testLoggingWithPsrLogLevels(string $level, int $expectedLevel): void { $this->logger->expects(self::once()) ->method('log') @@ -38,9 +36,7 @@ class PsrLoggerAdapterTest extends TestCase { $this->loggerAdapter->log($level, 'test message', ['app' => 'test']); } - /** - * @dataProvider dataPsrLoggingLevels - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataPsrLoggingLevels')] public function testLogLevelToInt(string $level, int $expectedLevel): void { $this->assertEquals($expectedLevel, PsrLoggerAdapter::logLevelToInt($level)); } @@ -58,9 +54,7 @@ class PsrLoggerAdapterTest extends TestCase { ]; } - /** - * @dataProvider dataInvalidLoggingLevel - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataInvalidLoggingLevel')] public function testInvalidLoggingLevel($level): void { $this->logger->expects(self::never()) ->method('log'); |