Passed
Pull Request — master (#233)
by Dmitriy
03:13
created

WebResponseTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateResponse() 0 8 1
1
<?php
2
3
namespace Yiisoft\Yii\Web\Tests;
4
5
use Nyholm\Psr7\Factory\Psr17Factory;
6
use PHPUnit\Framework\TestCase;
7
use Psr\Http\Message\ResponseInterface;
8
use Yiisoft\Yii\Web\WebResponse;
9
10
class WebResponseTest extends TestCase
11
{
12
    public function testCreateResponse(): void
13
    {
14
        $factory = new Psr17Factory();
15
        $webResponse = new WebResponse('test', $factory, $factory);
16
        $webResponse->getBody()->rewind();
17
18
        $this->assertInstanceOf(ResponseInterface::class, $webResponse);
19
        $this->assertSame('test', $webResponse->getBody()->getContents());
20
    }
21
}
22