You are here

public function LoggerInterfaceTest::testContextReplacement in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Psr/Log/Test/LoggerInterfaceTest.php \Psr\Log\Test\LoggerInterfaceTest::testContextReplacement()

File

lib/Psr/Log/Test/LoggerInterfaceTest.php, line 72

Class

LoggerInterfaceTest
Provides a base test class for ensuring compliance with the LoggerInterface

Namespace

Psr\Log\Test

Code

public function testContextReplacement() {
  $logger = $this
    ->getLogger();
  $logger
    ->info('{Message {nothing} {user} {foo.bar} a}', array(
    'user' => 'Bob',
    'foo.bar' => 'Bar',
  ));
  $expected = array(
    'info {Message {nothing} Bob Bar a}',
  );
  $this
    ->assertEquals($expected, $this
    ->getLogs());
}