CallableServiceLocatorTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A it_works_with_valid_callable() 0 7 1
1
<?php
2
3
namespace Devmachine\Bundle\ServicesInjectorBundle\Tests\ServiceLocator;
4
5
use Devmachine\Bundle\ServicesInjectorBundle\ServiceLocator\CallableServiceLocator;
6
7
class CallableServiceLocatorTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @test
11
     */
12
    public function it_works_with_valid_callable()
13
    {
14
        $locator = new CallableServiceLocator(function ($id) {
15
            return 'service_from_'.$id;
16
        });
17
        $this->assertSame('service_from_foo', $locator->get('foo'));
18
        $this->assertSame('service_from_bar', $locator->get('bar'));
19
    }
20
}
21