Completed
Push — master ( 7c51cd...7e9df0 )
by Dmitry
03:15
created

utWithoutVerboseFlag()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
/**
3
 * @author Dmitry Gladyshev <[email protected]>
4
 */
5
6
namespace Rucaptcha\Test;
7
8
9
use PHPUnit\Framework\TestCase;
10
use Psr\Log\LogLevel;
11
use Rucaptcha\Logger;
12
13
class LoggerTest extends TestCase
14
{
15
    /**
16
     * @dataProvider providerLevelMessages
17
     */
18
    public function testPrintingLogInStdOutIfVerboseFlag($level, $message)
19
    {
20
        $logger = new Logger;
21
22
        $logger->log($level, $message);
23
24
        $this->expectOutputRegex("#\[{$level}\]\s{$message}#ui");
25
    }
26
27
    public function providerLevelMessages()
28
    {
29
        return [
30
            [LogLevel::ALERT, 'hello, i am the Log Entry!'],
31
            [LogLevel::CRITICAL, 'hello, i am the Log Entry!'],
32
            [LogLevel::EMERGENCY, 'hello, i am the Log Entry!'],
33
            [LogLevel::DEBUG, 'hello, i am the Log Entry!'],
34
            [LogLevel::ERROR, 'hello, i am the Log Entry!'],
35
            [LogLevel::INFO, 'hello, i am the Log Entry!'],
36
            [LogLevel::WARNING, 'hello, i am the Log Entry!']
37
        ];
38
    }
39
}