UtilityTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testInvalidKey() 0 5 1
A testInvalidValue() 0 5 1
A testRootElementAliasNotFound() 0 6 1
1
<?php
2
namespace Thunder\Serializard\Tests;
3
4
use Thunder\Serializard\Utility\RootElementProviderUtility;
5
6
/**
7
 * @author Tomasz Kowalczyk <[email protected]>
8
 */
9
final class UtilityTest extends AbstractTestCase
10
{
11
    public function testInvalidKey()
12
    {
13
        $this->expectExceptionClass(\InvalidArgumentException::class);
14
        new RootElementProviderUtility([0 => 'Class']);
15
    }
16
17
    public function testInvalidValue()
18
    {
19
        $this->expectExceptionClass(\InvalidArgumentException::class);
20
        new RootElementProviderUtility(['Class' => 0]);
21
    }
22
23
    public function testRootElementAliasNotFound()
24
    {
25
        $utility = new RootElementProviderUtility([]);
26
        $this->expectExceptionClass(\RuntimeException::class);
27
        $utility('invalid');
28
    }
29
}
30