Test Failed
Push — master ( 4e95aa...c2cb3f )
by mcfog
01:51
created

NoopMiddlewareTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 71.43 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 10
loc 14
rs 10
c 0
b 0
f 0

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Nimo\Tests;
4
5
use Nimo\Middlewares\NoopMiddleware;
6
use PHPUnit\Framework\Assert;
7
8
class NoopMiddlewareTest extends NimoTestCase
9
{
10
11
    public function testNoopMiddleware()
12
    {
13
        $requst = $this->getRequestMock();
14
        $response = $this->getResponseMock();
15
        $handler = $this->assertedHandler($requst, $response);
16
        $middleware = new NoopMiddleware();
17
18
        $actualResponse = $middleware->process($requst, $handler);
19
        Assert::assertSame($response, $actualResponse);
20
    }
21
}
22