Passed
Push — master ( 20ba69...1ea7e6 )
by Victor
47s queued 11s
created

InspectorMiddlewareTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 8
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

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