Skip to content

Commit

Permalink
test: upgrade log test
Browse files Browse the repository at this point in the history
  • Loading branch information
theus77 committed Dec 21, 2023
1 parent 637142e commit b9bd34a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions EMS/common-bundle/tests/Unit/Common/Log/DoctrineHandlerAiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

use EMS\CommonBundle\Common\Log\DoctrineHandler;
use EMS\CommonBundle\Repository\LogRepository;
use Monolog\Level;
use Monolog\Logger;
use Monolog\LogRecord;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

Expand All @@ -26,16 +28,15 @@ protected function setUp(): void

public function testWrite(): void
{
$record = [
'message' => 'testMessage',
'level' => Logger::ERROR,
'level_name' => 'ERROR',
'context' => ['api_key' => '123456'],
'channel' => 'testChannel',
'formatted' => 'testFormatted',
'datetime' => new \DateTimeImmutable(),
'extra' => [],
];
$record = new LogRecord(
new \DateTimeImmutable(),
'testChannel',
Level::Error,
'testMessage',
['api_key' => '123456'],
[],
'testFormatted'
);

$secretValue = new \ReflectionClassConstant(DoctrineHandler::class, 'SECRET_VALUE');

Expand Down

0 comments on commit b9bd34a

Please sign in to comment.