Passed
Branch master (e8fd46)
by Alexey
02:50
created

MiddlewarePipelineFactorySpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 3
1
<?php
2
3
namespace spec\Venta\Routing\Factory;
4
5
use PhpSpec\ObjectBehavior;
6
use Venta\Contracts\Container\Container;
7
use Venta\Contracts\Routing\Middleware;
8
use Venta\Contracts\Routing\MiddlewarePipelineFactory;
9
use Venta\Routing\MiddlewarePipeline;
10
11
class MiddlewarePipelineFactorySpec extends ObjectBehavior
12
{
13
    function let(Container $container)
14
    {
15
        $this->beConstructedWith($container);
16
    }
17
18
    function it_creates_pipeline_from_array(Container $container, Middleware $middleware)
19
    {
20
        $container->get('middleware')->willReturn($middleware);
21
        $this->create(['middleware'])->shouldBeLike(
22
            (new MiddlewarePipeline())->withMiddleware($middleware->getWrappedObject())
23
        );
24
    }
25
26
    function it_is_initializable()
27
    {
28
        $this->shouldHaveType(MiddlewarePipelineFactory::class);
29
    }
30
31
}