Passed
Pull Request — master (#3)
by Vincent
08:42
created

ConfigurationResolverTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_unknwon_key() 0 7 1
A test_get_config() 0 9 1
1
<?php
2
3
namespace Bdf\PrimeBundle\Tests\Connection;
4
5
use Bdf\Prime\Configuration;
6
use Bdf\PrimeBundle\Connection\ConfigurationResolver;
7
use PHPUnit\Framework\TestCase;
8
use Psr\Container\ContainerInterface;
9
10
/**
11
 *
12
 */
13
class ConfigurationResolverTest extends TestCase
14
{
15
    /**
16
     *
17
     */
18
    public function test_unknwon_key()
19
    {
20
        $container = $this->createMock(ContainerInterface::class);
21
22
        $resolver = new ConfigurationResolver($container);
23
24
        $this->assertNull($resolver->getConfiguration('unknown'));
25
    }
26
27
    /**
28
     *
29
     */
30
    public function test_get_config()
31
    {
32
        $configuration = new Configuration();
33
        $container = $this->createMock(ContainerInterface::class);
34
        $container->expects($this->once())->method('get')->with('test')->willReturn($configuration);
35
36
        $resolver = new ConfigurationResolver($container, '%s');
37
38
        $this->assertSame($configuration, $resolver->getConfiguration('test'));
39
    }
40
}