ResolverTest::testDefaultRegistration()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 9
nc 2
nop 0
1
<?php
2
/**
3
 * Slim Framework controller creator (https://github.com/juliangut/slim-controller)
4
 *
5
 * @link https://github.com/juliangut/slim-controller for the canonical source repository
6
 *
7
 * @license https://raw.githubusercontent.com/juliangut/slim-controller/master/LICENSE
8
 */
9
10
namespace Jgut\Slim\Controller\Tests;
11
12
use Jgut\Slim\Controller\Resolver;
13
use Slim\Container;
14
15
/**
16
 * Controller resolver test class.
17
 */
18
class ResolverTest extends \PHPUnit_Framework_TestCase
19
{
20
    public function testDefaultRegistration()
21
    {
22
        $controllers = [
23
            'Jgut\Slim\Controller\Base',
24
        ];
25
26
        $container = new Container();
27
        foreach (Resolver::resolve($controllers) as $controller => $callback) {
28
            $container[$controller] = $callback;
29
        }
30
31
        static::assertInstanceOf(
32
            'Jgut\Slim\Controller\Base',
33
            $container->get('Jgut\Slim\Controller\Base')
34
        );
35
    }
36
}
37