You are here

public function LoggerInterfaceTest::testLogsAtAllLevels in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php \Psr\Log\Test\LoggerInterfaceTest::testLogsAtAllLevels()

@dataProvider provideLevelsAndMessages

File

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

Class

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

Namespace

Psr\Log\Test

Code

public function testLogsAtAllLevels($level, $message) {
  $logger = $this
    ->getLogger();
  $logger
    ->{$level}($message, array(
    'user' => 'Bob',
  ));
  $logger
    ->log($level, $message, array(
    'user' => 'Bob',
  ));
  $expected = array(
    $level . ' message of level ' . $level . ' with context: Bob',
    $level . ' message of level ' . $level . ' with context: Bob',
  );
  $this
    ->assertEquals($expected, $this
    ->getLogs());
}