use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
use Symfony\Bridge\Monolog\Tests\RecordFactory;
class ConsoleFormatterTest extends TestCase
{ /**
* @dataProvider providerFormatTests
*/
public function testFormat(array|LogRecord
$record,
$expectedMessage) { $formatter =
new ConsoleFormatter();
self::
assertSame($expectedMessage,
$formatter->
format($record));
} public static function providerFormatTests(): array
{ $currentDateTime =
new \
DateTimeImmutable();
$tests =
[ 'record with DateTime object in datetime field' =>
[ 'record' => RecordFactory::
create(datetime:
$currentDateTime),
'expectedMessage' =>
sprintf(