ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
FlowdockFormatterTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Monolog package.
5  *
6  * (c) Jordi Boggiano <j.boggiano@seld.be>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace Monolog\Formatter;
13 
14 use Monolog\Logger;
16 
18 {
22  public function testFormat()
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  }
39 
43  public function testFormatBatch()
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  }
55 }
const DEBUG
Detailed debug information.
Definition: Logger.php:33
testFormatBatch()
@ covers Monolog::formatBatch
$records
Definition: simple_test.php:22
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
formats the record to be used in the FlowdockHandler
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:53