ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Monolog\Handler\FleepHookHandlerTest Class Reference

More...

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

Public Member Functions

 setUp ()
 
 testConstructorSetsExpectedDefaults ()
 ::__construct More...
 
 testHandlerUsesLineFormatterWhichIgnoresEmptyArrays ()
 ::getDefaultFormatter More...
 
 testConnectionStringisConstructedCorrectly ()
 ::__construct More...
 

Data Fields

const TOKEN = '123abc'
 Default token to use in tests. More...
 

Private Attributes

 $handler
 

Additional Inherited Members

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

Detailed Description

Definition at line 21 of file FleepHookHandlerTest.php.

Member Function Documentation

◆ setUp()

Monolog\Handler\FleepHookHandlerTest::setUp ( )

Definition at line 33 of file FleepHookHandlerTest.php.

34  {
35  parent::setUp();
36 
37  if (!extension_loaded('openssl')) {
38  $this->markTestSkipped('This test requires openssl extension to run');
39  }
40 
41  // Create instances of the handler and logger for convenience
42  $this->handler = new FleepHookHandler(self::TOKEN);
43  }

◆ testConnectionStringisConstructedCorrectly()

Monolog\Handler\FleepHookHandlerTest::testConnectionStringisConstructedCorrectly ( )

::__construct

Definition at line 81 of file FleepHookHandlerTest.php.

References Monolog\Handler\FleepHookHandler\FLEEP_HOST.

82  {
83  $this->assertEquals('ssl://' . FleepHookHandler::FLEEP_HOST . ':443', $this->handler->getConnectionString());
84  }

◆ testConstructorSetsExpectedDefaults()

Monolog\Handler\FleepHookHandlerTest::testConstructorSetsExpectedDefaults ( )

::__construct

Definition at line 48 of file FleepHookHandlerTest.php.

References Monolog\Logger\DEBUG.

49  {
50  $this->assertEquals(Logger::DEBUG, $this->handler->getLevel());
51  $this->assertEquals(true, $this->handler->getBubble());
52  }
const DEBUG
Detailed debug information.
Definition: Logger.php:32

◆ testHandlerUsesLineFormatterWhichIgnoresEmptyArrays()

Monolog\Handler\FleepHookHandlerTest::testHandlerUsesLineFormatterWhichIgnoresEmptyArrays ( )

::getDefaultFormatter

Definition at line 57 of file FleepHookHandlerTest.php.

References array, Monolog\Logger\DEBUG, and Monolog\Logger\getLevelName().

58  {
59  $record = array(
60  'message' => 'msg',
61  'context' => array(),
62  'level' => Logger::DEBUG,
63  'level_name' => Logger::getLevelName(Logger::DEBUG),
64  'channel' => 'channel',
65  'datetime' => new \DateTime(),
66  'extra' => array(),
67  );
68 
69  $expectedFormatter = new LineFormatter(null, null, true, true);
70  $expected = $expectedFormatter->format($record);
71 
72  $handlerFormatter = $this->handler->getFormatter();
73  $actual = $handlerFormatter->format($record);
74 
75  $this->assertEquals($expected, $actual, 'Empty context and extra arrays should not be rendered');
76  }
const DEBUG
Detailed debug information.
Definition: Logger.php:32
Create styles array
The data for the language used.
static getLevelName($level)
Gets the name of the logging level.
Definition: Logger.php:458
+ Here is the call graph for this function:

Field Documentation

◆ $handler

Monolog\Handler\FleepHookHandlerTest::$handler
private

Definition at line 31 of file FleepHookHandlerTest.php.

◆ TOKEN

const Monolog\Handler\FleepHookHandlerTest::TOKEN = '123abc'

Default token to use in tests.

Definition at line 26 of file FleepHookHandlerTest.php.


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