Passed
Pull Request — master (#257)
by Wilmer
15:17
created

TagRequestTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 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
    public function testProcess(): void
13
    {
14
        $request = $this->createMock(ServerRequestInterface::class);
15
16
        $request
17
            ->expects($this->once())
18
            ->method('withAttribute')
19
            ->with(
20
                $this->equalTo('requestTag'),
21
                $this->isType('string')
22
            )
23
            ->willReturnSelf();
24
25
        $handler = $this->createMock(RequestHandlerInterface::class);
26
27
        (new TagRequest())->process($request, $handler);
28
    }
29
}
30