19 $this->outer->setBody(
'foo');
20 $this->assertEquals(
'foo', stream_get_contents($this->inner->getBodyAsStream()));
21 $this->assertEquals(
'foo', stream_get_contents($this->outer->getBodyAsStream()));
22 $this->assertEquals(
'foo', $this->inner->getBodyAsString());
23 $this->assertEquals(
'foo', $this->outer->getBodyAsString());
24 $this->assertEquals(
'foo', $this->inner->getBody());
25 $this->assertEquals(
'foo', $this->outer->getBody());
31 $this->outer->setHeaders([
35 $this->assertEquals([
'a' => [
'b']], $this->inner->getHeaders());
36 $this->assertEquals([
'a' => [
'b']], $this->outer->getHeaders());
38 $this->outer->setHeaders([
42 $this->assertEquals([
'a' => [
'b'],
'c' => [
'd']], $this->inner->getHeaders());
43 $this->assertEquals([
'a' => [
'b'],
'c' => [
'd']], $this->outer->getHeaders());
45 $this->outer->addHeaders([
49 $this->assertEquals([
'a' => [
'b'],
'c' => [
'd'],
'e' => [
'f']], $this->inner->getHeaders());
50 $this->assertEquals([
'a' => [
'b'],
'c' => [
'd'],
'e' => [
'f']], $this->outer->getHeaders());
55 $this->assertFalse($this->outer->hasHeader(
'a'));
56 $this->assertFalse($this->inner->hasHeader(
'a'));
57 $this->outer->setHeader(
'a',
'c');
58 $this->assertTrue($this->outer->hasHeader(
'a'));
59 $this->assertTrue($this->inner->hasHeader(
'a'));
61 $this->assertEquals(
'c', $this->inner->getHeader(
'A'));
62 $this->assertEquals(
'c', $this->outer->getHeader(
'A'));
64 $this->outer->addHeader(
'A',
'd');
68 $this->inner->getHeaderAsArray(
'A')
72 $this->outer->getHeaderAsArray(
'A')
75 $success = $this->outer->removeHeader(
'a');
77 $this->assertTrue($success);
78 $this->assertNull($this->inner->getHeader(
'A'));
79 $this->assertNull($this->outer->getHeader(
'A'));
81 $this->assertFalse($this->outer->removeHeader(
'i-dont-exist'));
86 $this->outer->setHttpVersion(
'1.0');
88 $this->assertEquals(
'1.0', $this->inner->getHttpVersion());
89 $this->assertEquals(
'1.0', $this->outer->getHttpVersion());
The Request class represents a single HTTP request.