ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Monolog\Formatter\FluentdFormatterTest Class Reference
+ Inheritance diagram for Monolog\Formatter\FluentdFormatterTest:
+ Collaboration diagram for Monolog\Formatter\FluentdFormatterTest:

Public Member Functions

 testConstruct ()
 Monolog::__construct Monolog::isUsingLevelsInTag More...
 
 testFormat ()
 Monologformat More...
 
 testFormatWithTag ()
 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 17 of file FluentdFormatterTest.php.

Member Function Documentation

◆ testConstruct()

Monolog\Formatter\FluentdFormatterTest::testConstruct ( )

Monolog::__construct Monolog::isUsingLevelsInTag

Definition at line 23 of file FluentdFormatterTest.php.

24  {
25  $formatter = new FluentdFormatter();
26  $this->assertEquals(false, $formatter->isUsingLevelsInTag());
27  $formatter = new FluentdFormatter(false);
28  $this->assertEquals(false, $formatter->isUsingLevelsInTag());
29  $formatter = new FluentdFormatter(true);
30  $this->assertEquals(true, $formatter->isUsingLevelsInTag());
31  }

◆ testFormat()

Monolog\Formatter\FluentdFormatterTest::testFormat ( )

Monologformat

Definition at line 36 of file FluentdFormatterTest.php.

References Monolog\TestCase\getRecord(), and Monolog\Logger\WARNING.

37  {
38  $record = $this->getRecord(Logger::WARNING);
39  $record['datetime'] = new \DateTime("@0");
40 
41  $formatter = new FluentdFormatter();
42  $this->assertEquals(
43  '["test",0,{"message":"test","extra":[],"level":300,"level_name":"WARNING"}]',
44  $formatter->format($record)
45  );
46  }
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
+ Here is the call graph for this function:

◆ testFormatWithTag()

Monolog\Formatter\FluentdFormatterTest::testFormatWithTag ( )

Monologformat

Definition at line 51 of file FluentdFormatterTest.php.

References Monolog\Logger\ERROR, and Monolog\TestCase\getRecord().

52  {
53  $record = $this->getRecord(Logger::ERROR);
54  $record['datetime'] = new \DateTime("@0");
55 
56  $formatter = new FluentdFormatter(true);
57  $this->assertEquals(
58  '["test.error",0,{"message":"test","extra":[]}]',
59  $formatter->format($record)
60  );
61  }
const ERROR
Runtime errors.
Definition: Logger.php:57
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: