Passed
Push — master ( d47bdf...6296de )
by Kirill
03:33
created

EventTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testListenDebug() 0 15 1
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Logger;
13
14
use PHPUnit\Framework\TestCase;
15
use Psr\Log\LogLevel;
16
use Spiral\Logger\Event\LogEvent;
17
18
class EventTest extends TestCase
19
{
20
    public function testListenDebug(): void
21
    {
22
        $e = new LogEvent(
23
            new \DateTime(),
24
            'default',
25
            LogLevel::DEBUG,
26
            'message',
27
            ['context']
28
        );
29
30
        $this->assertInstanceOf(\DateTimeInterface::class, $e->getTime());
31
        $this->assertSame('default', $e->getChannel());
32
        $this->assertSame(LogLevel::DEBUG, $e->getLevel());
33
        $this->assertSame('message', $e->getMessage());
34
        $this->assertSame(['context'], $e->getContext());
35
    }
36
}
37