LogFormatterTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFormatBatch() 0 8 1
A testFormat() 0 5 1
1
<?php
2
3
namespace LeKoala\DebugBar\Test\Messages;
4
5
use LeKoala\DebugBar\Messages\LogFormatter;
6
use SilverStripe\Dev\SapphireTest;
7
8
class LogFormatterTest extends SapphireTest
9
{
10
    public function testFormat()
11
    {
12
        $this->assertSame(
13
            'I am a log message',
14
            (new LogFormatter)->format(['foo' => 'bar', 'message_level' => 'blah', 'message' => 'I am a log message'])
15
        );
16
    }
17
18
    public function testFormatBatch()
19
    {
20
        $this->assertSame(
21
            "foo\nbar\nbaz",
22
            (new LogFormatter)->formatBatch([
23
                ['message' => 'foo'],
24
                ['message' => 'bar'],
25
                ['message' => 'baz'],
26
            ])
27
        );
28
    }
29
}
30