10000 minor #42175 [Cache] Don't use deprecated TestLogger class (derrabus) · symfony/symfony@c38141e · GitHub
[go: up one dir, main page]

Skip to content

Commit c38141e

Browse files
committed
minor #42175 [Cache] Don't use deprecated TestLogger class (derrabus)
This PR was merged into the 5.2 branch. Discussion ---------- [Cache] Don't use deprecated TestLogger class | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A `TestLogger` has been removed with `psr/log` 2. I'm replacing it with a local implementation to make our tests pass again. Commits ------- 3ea73c7 Don't use deprecated TestLogger class
2 parents 96c1045 + 3ea73c7 commit c38141e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Symfony/Component/Cache/Tests/Messenger/EarlyExpirationDispatcherTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace Symfony\Component\Cache\Tests\Messenger;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Psr\Log\AbstractLogger;
1516
use Psr\Log\LoggerInterface;
16-
use Psr\Log\Test\TestLogger;
1717
use Symfony\Component\Cache\Adapter\AdapterInterface;
1818
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
1919
use Symfony\Component\Cache\CacheItem;
@@ -132,3 +132,17 @@ public function __invoke(CacheItem $item)
132132
$this->assertSame($expected, $logger->records);
133133
}
134134
}
135+
136+
final class TestLogger extends AbstractLogger
137+
{
138+
public $records = [];
139+
140+
public function log($level, $message, array $context = []): void
141+
{
142+
$this->records[] = [
143+
'level' => $level,
144+
'message' => $message,
145+
'context' => $context,
146+
];
147+
}
148+
}

0 commit comments

Comments
 (0)
0