ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Monolog\Handler\RollbarHandlerTest Class Reference
+ Inheritance diagram for Monolog\Handler\RollbarHandlerTest:
+ Collaboration diagram for Monolog\Handler\RollbarHandlerTest:

Public Member Functions

 testExceptionLogLevel ()
 When reporting exceptions to Rollbar the level has to be set in the payload data. More...
 

Data Fields

 $reportedExceptionArguments = null
 

Protected Member Functions

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

Private Member Functions

 setupRollbarNotifierMock ()
 
 createHandler ()
 
 createExceptionRecord ($level=Logger::DEBUG, $message='test', $exception=null)
 

Private Attributes

 $rollbarNotifier
 

Detailed Description

Author
Erik Johansson erik..nosp@m.pm.j.nosp@m.ohans.nosp@m.son@.nosp@m.gmail.nosp@m..com
See also
https://rollbar.com/docs/notifier/rollbar-php/

@coversDefaultClass Monolog\Handler\RollbarHandler

Definition at line 25 of file RollbarHandlerTest.php.

Member Function Documentation

◆ createExceptionRecord()

Monolog\Handler\RollbarHandlerTest::createExceptionRecord (   $level = Logger::DEBUG,
  $message = 'test',
  $exception = null 
)
private

Definition at line 78 of file RollbarHandlerTest.php.

79 {
80 return $this->getRecord($level, $message, array(
81 'exception' => $exception ?: new Exception()
82 ));
83 }
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
catch(Exception $e) $message

References $message, and Monolog\TestCase\getRecord().

Referenced by Monolog\Handler\RollbarHandlerTest\testExceptionLogLevel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createHandler()

Monolog\Handler\RollbarHandlerTest::createHandler ( )
private

Definition at line 73 of file RollbarHandlerTest.php.

74 {
75 return new RollbarHandler($this->rollbarNotifier, Logger::DEBUG);
76 }
const DEBUG
Detailed debug information.
Definition: Logger.php:33

References Monolog\Logger\DEBUG.

Referenced by Monolog\Handler\RollbarHandlerTest\testExceptionLogLevel().

+ Here is the caller graph for this function:

◆ setUp()

Monolog\Handler\RollbarHandlerTest::setUp ( )
protected

Definition at line 37 of file RollbarHandlerTest.php.

38 {
39 parent::setUp();
40
42 }

References Monolog\Handler\RollbarHandlerTest\setupRollbarNotifierMock().

+ Here is the call graph for this function:

◆ setupRollbarNotifierMock()

Monolog\Handler\RollbarHandlerTest::setupRollbarNotifierMock ( )
private

Definition at line 57 of file RollbarHandlerTest.php.

58 {
59 $this->rollbarNotifier = $this->getMockBuilder('RollbarNotifier')
60 ->setMethods(array('report_message', 'report_exception', 'flush'))
61 ->getMock();
62
63 $that = $this;
64
65 $this->rollbarNotifier
66 ->expects($this->any())
67 ->method('report_exception')
68 ->willReturnCallback(function ($exception, $context, $payload) use ($that) {
69 $that->reportedExceptionArguments = compact('exception', 'context', 'payload');
70 });
71 }
$context
Definition: webdav.php:25

References $context.

Referenced by Monolog\Handler\RollbarHandlerTest\setUp().

+ Here is the caller graph for this function:

◆ testExceptionLogLevel()

Monolog\Handler\RollbarHandlerTest::testExceptionLogLevel ( )

When reporting exceptions to Rollbar the level has to be set in the payload data.

Definition at line 48 of file RollbarHandlerTest.php.

49 {
50 $handler = $this->createHandler();
51
53
54 $this->assertEquals('debug', $this->reportedExceptionArguments['payload']['level']);
55 }
createExceptionRecord($level=Logger::DEBUG, $message='test', $exception=null)
$handler

References $handler, Monolog\Handler\RollbarHandlerTest\createExceptionRecord(), Monolog\Handler\RollbarHandlerTest\createHandler(), and Monolog\Logger\DEBUG.

+ Here is the call graph for this function:

Field Documentation

◆ $reportedExceptionArguments

Monolog\Handler\RollbarHandlerTest::$reportedExceptionArguments = null

Definition at line 35 of file RollbarHandlerTest.php.

◆ $rollbarNotifier

Monolog\Handler\RollbarHandlerTest::$rollbarNotifier
private

Definition at line 30 of file RollbarHandlerTest.php.


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