You are here

public function LoggerInterfaceTest::testContextExceptionKeyCanBeExceptionOrOtherValues in TMGMT Translator Smartling 8.2

Same name and namespace in other branches
  1. 8.4 vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php \Psr\Log\Test\LoggerInterfaceTest::testContextExceptionKeyCanBeExceptionOrOtherValues()
  2. 8.3 vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php \Psr\Log\Test\LoggerInterfaceTest::testContextExceptionKeyCanBeExceptionOrOtherValues()

File

vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php, line 121

Class

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

Namespace

Psr\Log\Test

Code

public function testContextExceptionKeyCanBeExceptionOrOtherValues() {
  $logger = $this
    ->getLogger();
  $logger
    ->warning('Random message', array(
    'exception' => 'oops',
  ));
  $logger
    ->critical('Uncaught Exception!', array(
    'exception' => new \LogicException('Fail'),
  ));
  $expected = array(
    'warning Random message',
    'critical Uncaught Exception!',
  );
  $this
    ->assertEquals($expected, $this
    ->getLogs());
}