SingletonWrapperTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testInvoke() 0 10 1
1
<?php
2
namespace Acelaya\SlimContainerSm\Test\Factory;
3
4
use Acelaya\SlimContainerSm\Container;
5
use Acelaya\SlimContainerSm\Factory\CallbackWrapper;
6
use PHPUnit_Framework_TestCase as TestCase;
7
8
class SingletonWrapperTest extends TestCase
9
{
10
    /**
11
     * @var CallbackWrapper
12
     */
13
    private $wrapper;
14
15
    public function testInvoke()
16
    {
17
        $expected = new \stdClass();
18
        $originalFactory = function () use ($expected) {
19
            return $expected;
20
        };
21
        $container = new Container();
22
        $this->wrapper = new CallbackWrapper($container, $originalFactory);
23
        $this->assertSame($expected, call_user_func($this->wrapper, $container));
24
    }
25
}
26