Completed
Pull Request — master (#47)
by Robbie
01:32
created

LogFormatterTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFormat() 0 7 1
A testFormatBatch() 0 11 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