Passed
Push — master ( c9493e...51929d )
by Victor
01:45
created

InspectorMiddlewareTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testProcessShouldLogDebugInformationToConsole() 0 11 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Shoot\Shoot\Tests\Middleware;
5
6
use PHPUnit\Framework\TestCase;
7
use Shoot\Shoot\Context;
8
use Shoot\Shoot\Middleware\InspectorMiddleware;
9
use Shoot\Shoot\Tests\Fixtures\MiddlewareCallback;
10
use Shoot\Shoot\Tests\Fixtures\ProductPresentationModel;
11
use Shoot\Shoot\Tests\Fixtures\ViewFactory;
12
13
final class InspectorMiddlewareTest extends TestCase
14
{
15
    /**
16
     * @return void
17
     */
18
    public function testProcessShouldLogDebugInformationToConsole()
19
    {
20
        $this->expectOutputRegex('/<script>.+<\/script>/');
21
22
        $context = new Context();
23
        $middleware = new InspectorMiddleware();
24
        $next = new MiddlewareCallback();
25
        $presentationModel = new ProductPresentationModel();
26
        $view = ViewFactory::create($presentationModel);
27
28
        $middleware->process($view, $context, $next);
29
    }
30
}
31