ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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  }

◆ testHandlesAllLevels()

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

logLevelProvider

Definition at line 37 of file PsrHandlerTest.php.

References $context, $handler, $message, and Sabre\Event\once().

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  }
$context
Definition: webdav.php:25
catch(Exception $e) $message
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
$handler
+ Here is the call graph for this function:

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