Robbie\Psr7\Tests\HttpResponseAdapterTest
Synopsis
class HttpResponseAdapterTest
extends PHPUnit_Framework_TestCase
{
- // members
- protected boolean $backupGlobals = false;
- // methods
- public void testReturnsPsr7CompliantClass()
- public void testBodyMatchesInputBody()
- public void testSuccessfulByDefault()
- public void testImmutablyAddHeaders()
- public void testCanImportPsr7InterfaceToHttpResponse()
- public void testImmutablyRemoveHeaders()
- protected ResponseInterface getInterface()
Hierarchy
Extends
- PHPUnit_Framework_TestCase
Members
protected
-
$backupGlobals
{@inheritDoc}
Methods
protected
- getInterface() — Create a mocked HTTP response for "adapting"
public
- testBodyMatchesInputBody() — Assert that the input can be retrieved again
- testCanImportPsr7InterfaceToHttpResponse() — Test that a PSR-7 interface can be imported (with multiple headers converted to a single line) to a HTTPResponse class
- testImmutablyAddHeaders() — Ensure that as per PSR-7 specifications the interfaces are immutable, and different instances returned when we add headers to it (for example)
- testImmutablyRemoveHeaders() — Ensure that headers can be removed from the response, and that the return is immutable
- testReturnsPsr7CompliantClass() — Ensure that the Response class returned is a PSR-7 interface
- testSuccessfulByDefault() — Test that without providing a status code, the default is 200