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

Public Member Functions

 testFormat ()
 Monologformat More...
 
 testFormatBatch ()
 @ covers Monolog::formatBatch 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 FlowdockFormatterTest.php.

Member Function Documentation

◆ testFormat()

Monolog\Formatter\FlowdockFormatterTest::testFormat ( )

Monologformat

Definition at line 22 of file FlowdockFormatterTest.php.

References array, and Monolog\TestCase\getRecord().

23  {
24  $formatter = new FlowdockFormatter('test_source', 'source@test.com');
25  $record = $this->getRecord();
26 
27  $expected = array(
28  'source' => 'test_source',
29  'from_address' => 'source@test.com',
30  'subject' => 'in test_source: WARNING - test',
31  'content' => 'test',
32  'tags' => array('#logs', '#warning', '#test'),
33  'project' => 'test_source',
34  );
35  $formatted = $formatter->format($record);
36 
37  $this->assertEquals($expected, $formatted['flowdock']);
38  }
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ testFormatBatch()

Monolog\Formatter\FlowdockFormatterTest::testFormatBatch ( )

@ covers Monolog::formatBatch

Definition at line 43 of file FlowdockFormatterTest.php.

References $records, array, Monolog\Logger\DEBUG, Monolog\TestCase\getRecord(), and Monolog\Logger\WARNING.

44  {
45  $formatter = new FlowdockFormatter('test_source', 'source@test.com');
46  $records = array(
47  $this->getRecord(Logger::WARNING),
48  $this->getRecord(Logger::DEBUG),
49  );
50  $formatted = $formatter->formatBatch($records);
51 
52  $this->assertArrayHasKey('flowdock', $formatted[0]);
53  $this->assertArrayHasKey('flowdock', $formatted[1]);
54  }
const DEBUG
Detailed debug information.
Definition: Logger.php:32
$records
Definition: simple_test.php:22
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
Create styles array
The data for the language used.
+ Here is the call graph for this function:

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