Passed
Push — master ( c44d00...13b3c2 )
by David
53s
created

AbstractMiddlewareTest.php$0 ➔ process()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
1
<?php
2
3
4
namespace TheCodingMachine\Middlewares;
5
6
use Interop\Http\ServerMiddleware\DelegateInterface;
7
use PHPUnit\Framework\TestCase;
8
use Psr\Http\Message\ServerRequestInterface;
9
use Zend\Diactoros\Response\TextResponse;
10
11
abstract class AbstractMiddlewareTest extends \PHPUnit_Framework_TestCase
12
{
13
    protected function getDelegate() : DelegateInterface
14
    {
15
        return new class implements DelegateInterface {
16
17
            /**
18
             * Dispatch the next available middleware and return the response.
19
             *
20
             * @param ServerRequestInterface $request
21
             *
22
             * @return ResponseInterface
23
             */
24
            public function process(ServerRequestInterface $request)
25
            {
26
                return new TextResponse('foobar');
27
            }
28
        };
29
    }
30
}
31