guzzleResponse = new GuzzleResponse(418);
}
public function testGetBody(): void {
$response = new Response($this->guzzleResponse->withBody(Utils::streamFor('MyResponse')));
$this->assertSame('MyResponse', $response->getBody());
}
public function testGetStatusCode(): void {
$response = new Response($this->guzzleResponse);
$this->assertSame(418, $response->getStatusCode());
}
public function testGetHeader(): void {
$response = new Response($this->guzzleResponse->withHeader('bar', 'foo'));
$this->assertSame('foo', $response->getHeader('bar'));
}
public function testGetHeaders(): void {
$response = new Response($this->guzzleResponse
->withHeader('bar', 'foo')
->withHeader('x-awesome', 'yes')
);
$expected = [
'bar' => [
0 => 'foo',
],
'x-awesome' => [
0 => 'yes',
],
];
$this->assertSame($expected, $response->getHeaders());
$this->assertSame('yes', $response->getHeader('x-awesome'));
}
}
ption value='8.7'>8.7
Vaadin 6, 7, 8 is a Java framework for modern Java web applications: https://github.com/vaadin/framework | www-data |
blob: 9dd97bfb85b9008c82c4274f379e95b8a0eaf65e (
plain)