Passed
Pull Request — master (#137)
by Zhukov
02:37
created

TagRequestTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 11
c 2
b 1
f 0
dl 0
loc 18
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
    public function testProcess()
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