ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Monolog\Formatter\LogglyFormatterTest Class Reference
+ Inheritance diagram for Monolog\Formatter\LogglyFormatterTest:
+ Collaboration diagram for Monolog\Formatter\LogglyFormatterTest:

Public Member Functions

 testConstruct ()
 Monolog::__construct More...
 
 testFormat ()
 Monologformat More...
 

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 16 of file LogglyFormatterTest.php.

Member Function Documentation

◆ testConstruct()

Monolog\Formatter\LogglyFormatterTest::testConstruct ( )

Monolog::__construct

Definition at line 21 of file LogglyFormatterTest.php.

References Monolog\Formatter\JsonFormatter\BATCH_MODE_JSON, and Monolog\Formatter\JsonFormatter\BATCH_MODE_NEWLINES.

22  {
23  $formatter = new LogglyFormatter();
24  $this->assertEquals(LogglyFormatter::BATCH_MODE_NEWLINES, $formatter->getBatchMode());
25  $formatter = new LogglyFormatter(LogglyFormatter::BATCH_MODE_JSON);
26  $this->assertEquals(LogglyFormatter::BATCH_MODE_JSON, $formatter->getBatchMode());
27  }

◆ testFormat()

Monolog\Formatter\LogglyFormatterTest::testFormat ( )

Monologformat

Definition at line 32 of file LogglyFormatterTest.php.

References Monolog\TestCase\getRecord().

33  {
34  $formatter = new LogglyFormatter();
35  $record = $this->getRecord();
36  $formatted_decoded = json_decode($formatter->format($record), true);
37  $this->assertArrayHasKey("timestamp", $formatted_decoded);
38  $this->assertEquals(new \DateTime($formatted_decoded["timestamp"]), $record["datetime"]);
39  }
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
+ Here is the call graph for this function:

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