Passed
Pull Request — master (#137)
by Zhukov
03:58
created

TagRequestTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testProcess() 0 16 1
1
<?php
2
3
namespace Yiisoft\Yii\Web\Tests\Middleware;
4
5
use Psr\Http\Message\ServerRequestInterface;
6
use Psr\Http\Server\RequestHandlerInterface;
7
use Yiisoft\Yii\Web\Middleware\TagRequest;
8
use PHPUnit\Framework\TestCase;
9
10
class TagRequestTest extends TestCase
11
{
12
13
    public function testProcess()
14
    {
15
        $request = $this->createMock(ServerRequestInterface::class);
16
17
        $request
18
            ->expects($this->once())
19
            ->method('withAttribute')
20
            ->with(
21
                $this->equalTo('requestTag'),
22
                $this->isType('string')
23
            )
24
            ->willReturnSelf();
25
26
        $handler = $this->createMock(RequestHandlerInterface::class);
27
28
        (new TagRequest())->process($request, $handler);
29
    }
30
}
31