ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
12namespace Monolog\Formatter;
13
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(
49 );
50 $formatted = $formatter->formatBatch($records);
51
52 $this->assertArrayHasKey('flowdock', $formatted[0]);
53 $this->assertArrayHasKey('flowdock', $formatted[1]);
54 }
55}
testFormatBatch()
@ covers Monolog\Formatter\FlowdockFormatter::formatBatch
testFormat()
@covers Monolog\Formatter\FlowdockFormatter::format
formats the record to be used in the FlowdockHandler
Monolog log channel.
Definition: Logger.php:28
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
const DEBUG
Detailed debug information.
Definition: Logger.php:32
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
$records
Definition: simple_test.php:17