1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
<?php
/**
* Slim Framework (https://slimframework.com)
*
* @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License)
*/
declare(strict_types=1);
namespace Slim\Tests\Psr7\Factory;
use PHPUnit\Framework\TestCase as ResponseFactoryTestCase;
//use Interop\Http\Factory\ResponseFactoryTestCase;
use Psr\Http\Message\ResponseInterface;
use Slim\Psr7\Factory\ResponseFactory;
/**
* @group excluded
*/
#[\PHPUnit\Framework\Attributes\Group('excluded')]
class ResponseFactoryTest extends ResponseFactoryTestCase
{
protected function createResponseFactory(): ResponseFactory
{
return new ResponseFactory();
}
protected function assertResponseCodeAndReasonPhrase(ResponseInterface $response, int $code, string $reasonPhrase)
{
$this->assertInstanceOf(ResponseInterface::class, $response);
$this->assertSame($code, $response->getStatusCode());
$this->assertSame($reasonPhrase, $response->getReasonPhrase());
}
public function testCreateResponseWithReasonPhrase()
{
$response = $this->factory->createResponse($code, 'Reason');
$this->assertResponse($response, $code);
$this->assertResponseCodeAndReasonPhrase($response, $code, 'Reason');
}
}
|