Code Duplication    Length = 7-7 lines in 3 locations

test/HtmlCompressMiddlewareTest.php 3 locations

@@ 33-39 (lines=7) @@
30
     * @throws \Psr\Container\ContainerExceptionInterface
31
     * @throws \Psr\Container\NotFoundExceptionInterface
32
     */
33
    public function testHtmlResponseIsCompressed(): void
34
    {
35
        $middleware = (new HtmlCompressMiddlewareFactory())->__invoke(new MockContainer(false));
36
        $response = $middleware->process($this->request, new MockRequestHandler('text/html'));
37
38
        $this->assertEquals('test test', $response->getBody()->getContents());
39
    }
40
41
    /**
42
     * @throws \Psr\Container\ContainerExceptionInterface
@@ 45-51 (lines=7) @@
42
     * @throws \Psr\Container\ContainerExceptionInterface
43
     * @throws \Psr\Container\NotFoundExceptionInterface
44
     */
45
    public function testJsonResponseIsNotCompressed(): void
46
    {
47
        $middleware = (new HtmlCompressMiddlewareFactory())->__invoke(new MockContainer(false));
48
        $response = $middleware->process($this->request, new MockRequestHandler('application/json'));
49
50
        $this->assertEquals('test' . PHP_EOL . 'test', $response->getBody()->getContents());
51
    }
52
53
    /**
54
     * @throws \Psr\Container\ContainerExceptionInterface
@@ 57-63 (lines=7) @@
54
     * @throws \Psr\Container\ContainerExceptionInterface
55
     * @throws \Psr\Container\NotFoundExceptionInterface
56
     */
57
    public function testDebugHtmlResponseIsNotCompressed(): void
58
    {
59
        $middleware = (new HtmlCompressMiddlewareFactory())->__invoke(new MockContainer(true));
60
        $response = $middleware->process($this->request, new MockRequestHandler('text/html'));
61
62
        $this->assertEquals('test' . PHP_EOL . 'test', $response->getBody()->getContents());
63
    }
64
}