ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Monolog\Handler\PsrHandlerTest Class Reference

Monolog::handle More...

+ Inheritance diagram for Monolog\Handler\PsrHandlerTest:
+ Collaboration diagram for Monolog\Handler\PsrHandlerTest:

Public Member Functions

 logLevelProvider ()
 
 testHandlesAllLevels ($levelName, $level)
 logLevelProvider More...
 

Additional Inherited Members

- Protected Member Functions inherited from Monolog\TestCase
 getRecord ($level=Logger::WARNING, $message='test', $context=array())
 
 getMultipleRecords ()
 
 getIdentityFormatter ()
 

Detailed Description

Monolog::handle

Definition at line 20 of file PsrHandlerTest.php.

Member Function Documentation

◆ logLevelProvider()

Monolog\Handler\PsrHandlerTest::logLevelProvider ( )

Definition at line 22 of file PsrHandlerTest.php.

References array.

23  {
24  $levels = array();
25  $monologLogger = new Logger('');
26 
27  foreach ($monologLogger->getLevels() as $levelName => $level) {
28  $levels[] = array($levelName, $level);
29  }
30 
31  return $levels;
32  }
Create styles array
The data for the language used.

◆ testHandlesAllLevels()

Monolog\Handler\PsrHandlerTest::testHandlesAllLevels (   $levelName,
  $level 
)

logLevelProvider

Definition at line 37 of file PsrHandlerTest.php.

References $handler, $message, and array.

38  {
39  $message = 'Hello, world! ' . $level;
40  $context = array('foo' => 'bar', 'level' => $level);
41 
42  $psrLogger = $this->getMock('Psr\Log\NullLogger');
43  $psrLogger->expects($this->once())
44  ->method('log')
45  ->with(strtolower($levelName), $message, $context);
46 
47  $handler = new PsrHandler($psrLogger);
48  $handler->handle(array('level' => $level, 'level_name' => $levelName, 'message' => $message, 'context' => $context));
49  }
catch(Exception $e) $message
Create styles array
The data for the language used.
$handler

The documentation for this class was generated from the following file: