LogLevelTest::testGetLevelName_throwsException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace KochTest\Logger;
4
5
use Koch\Logger\LogLevel;
6
7
class LogLevelTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @covers Koch\Logger\LogLevel::getLevelName
11
     * @expectedException InvalidArgumentException
12
     * @expectedExceptionMessage Logging level "not-existant-level" is not defined, use one of:
13
     * 100, 200, 250, 300, 400, 500, 550, 600
14
     */
15
    public function testGetLevelName_throwsException()
0 ignored issues
show
Coding Style introduced by
function testGetLevelName_throwsException() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
16
    {
17
        LogLevel::getLevelName('not-existant-level');
18
    }
19
20
    /**
21
     * @covers Koch\Logger\LogLevel::getLevelName
22
     */
23
    public function testGetLevelName()
24
    {
25
        $name = LogLevel::getLevelName(LogLevel::INFO); // 200
26
        $this->assertEquals('INFO', $name);
27
    }
28
}
29