Completed
Push — master ( 3e6e05...cbeae7 )
by Chad
9s
created

LevelValidatorTraitTest::validateLevelValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace SubjectivePHPTest\Psr\Log;
4
5
use SubjectivePHP\Psr\Log\LevelValidatorTrait;
6
7
/**
8
 * @coversDefaultClass \SubjectivePHP\Psr\Log\LevelValidatorTrait
9
 * @covers ::<private>
10
 */
11
final class LevelValidatorTraitTest extends \PHPUnit\Framework\TestCase
12
{
13
    use LevelValidatorTrait;
14
15
    /**
16
     * @test
17
     * @covers ::validateLevel
18
     *
19
     * @return void
20
     */
21
    public function validateLevelValid()
22
    {
23
        foreach ((new \ReflectionClass('\\Psr\\Log\\LogLevel'))->getConstants() as $constant) {
24
            $this->assertNull($this->validateLevel($constant));
25
        }
26
    }
27
28
    /**
29
     * @test
30
     * @covers ::validateLevel
31
     * @expectedException \Psr\Log\InvalidArgumentException
32
     *
33
     * @return void
34
     */
35
    public function validateLevelInvalid()
36
    {
37
        $this->validateLevel('invalid');
38
    }
39
}
40