Passed
Pull Request — master (#2)
by Victor
02:09
created

InspectorMiddlewareTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

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