aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Log/PsrLoggerAdapterTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Log/PsrLoggerAdapterTest.php')
-rw-r--r--tests/lib/Log/PsrLoggerAdapterTest.php16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/lib/Log/PsrLoggerAdapterTest.php b/tests/lib/Log/PsrLoggerAdapterTest.php
index cc9ddea378a..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,14 +36,12 @@ 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));
}
- public function dataPsrLoggingLevels(): array {
+ public static function dataPsrLoggingLevels(): array {
return [
[LogLevel::ALERT, ILogger::ERROR],
[LogLevel::CRITICAL, ILogger::ERROR],
@@ -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');
@@ -69,7 +63,7 @@ class PsrLoggerAdapterTest extends TestCase {
$this->loggerAdapter->log($level, 'valid message');
}
- public function dataInvalidLoggingLevel(): array {
+ public static function dataInvalidLoggingLevel(): array {
return [
// invalid string
['this is not a level'],