Completed
Branch master (c0d8ef)
by Yaroslav
06:36
created

ClassMapTest::testHas()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 *
5
 * (c) Yaroslav Honcharuk <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Yarhon\RouteGuardBundle\Tests\DependencyInjection\Container;
12
13
use PHPUnit\Framework\TestCase;
14
use Yarhon\RouteGuardBundle\DependencyInjection\Container\ClassMap;
15
use Yarhon\RouteGuardBundle\Exception\InvalidArgumentException;
16
17
/**
18
 * @author Yaroslav Honcharuk <[email protected]>
19
 */
20
class ClassMapTest extends TestCase
21
{
22
    public function testHas()
23
    {
24
        $map = new ClassMap(['test1' => 'class_name']);
25
26
        $this->assertTrue($map->has('test1'));
27
        $this->assertFalse($map->has('test2'));
28
    }
29
30
    public function testGet()
31
    {
32
        $map = new ClassMap(['test1' => 'class_name']);
33
34
        $this->assertEquals('class_name', $map->get('test1'));
35
    }
36
37
    public function testGetException()
38
    {
39
        $map = new ClassMap(['test1' => 'class_name']);
40
41
        $this->expectException(InvalidArgumentException::class);
42
43
        $map->get('test2');
44
    }
45
}
46