toString() public static méthode

Create a string representation of a response.
public static toString ( Psr\Http\Message\ResponseInterface $response ) : string
$response Psr\Http\Message\ResponseInterface
Résultat string
Exemple #1
0
 public function testOmitsReasonPhraseFromStatusLineIfEmpty()
 {
     $response = (new Response())->withStatus(299)->withAddedHeader('X-Foo-Bar', 'Baz');
     $response->getBody()->write('Content!');
     $message = Serializer::toString($response);
     $this->assertContains("HTTP/1.1 299\r\n", $message);
 }