Passed
Push — master ( 826ad0...fdfa6d )
by Maurício
09:44 queued 01:09
created

LoggingTest::testGetLogMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpMyAdmin\Tests;
6
7
use PhpMyAdmin\Logging;
8
9
/**
10
 * @covers \PhpMyAdmin\Logging
11
 */
12
class LoggingTest extends AbstractTestCase
13
{
14
    public function testGetLogMessage(): void
15
    {
16
        $_SERVER['REMOTE_ADDR'] = '0.0.0.0';
17
        $log = Logging::getLogMessage('user', 'ok');
18
        $this->assertEquals('user authenticated: user from 0.0.0.0', $log);
19
        $log = Logging::getLogMessage('user', 'error');
20
        $this->assertEquals('user denied: user (error) from 0.0.0.0', $log);
21
    }
22
}
23