Completed
Pull Request — master (#138)
by Zhukov
02:33
created

ChainTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 15
rs 10
eloc 9
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testProcess() 0 13 1
1
<?php
2
3
namespace Yiisoft\Yii\Web\Tests\Middleware;
4
5
use Psr\Http\Message\ResponseInterface;
6
use Psr\Http\Message\ServerRequestInterface;
7
use Psr\Http\Server\MiddlewareInterface;
8
use Psr\Http\Server\RequestHandlerInterface;
9
use Yiisoft\Yii\Web\Middleware\Chain;
10
use PHPUnit\Framework\TestCase;
11
12
class ChainTest extends TestCase
13
{
14
    public function testProcess()
15
    {
16
        $request = $this->createMock(ServerRequestInterface::class);
17
        $handler = $this->createMock(RequestHandlerInterface::class);
18
19
        $middleware1 = $this->createMock(MiddlewareInterface::class);
20
        $middleware1->expects($this->once())->method('process');
21
22
        $middleware2 = $this->createMock(MiddlewareInterface::class);
23
        $middleware2->expects($this->once())->method('process');
24
25
        $chain = new Chain($middleware1, $middleware2);
26
        $response = $chain->process($request, $handler);
0 ignored issues
show
Unused Code introduced by
The assignment to $response is dead and can be removed.
Loading history...
27
    }
28
}
29