|
@@ 300-308 (lines=9) @@
|
| 297 |
|
* Existing values for the specified header will be maintained. The new |
| 298 |
|
* value(s) will be appended to the existing list. |
| 299 |
|
*/ |
| 300 |
|
function it_returns_a_new_request_with_a_header_added_with_a_single_value() |
| 301 |
|
{ |
| 302 |
|
$header = "foo"; |
| 303 |
|
$value = "qux"; |
| 304 |
|
|
| 305 |
|
$request = $this->withAddedHeader($header, $value); |
| 306 |
|
|
| 307 |
|
$request->getHeaderLine($header)->shouldBe("bar,baz,qux"); |
| 308 |
|
} |
| 309 |
|
|
| 310 |
|
/** |
| 311 |
|
* While header names are case-insensitive, the casing of the header will |
|
@@ 314-322 (lines=9) @@
|
| 311 |
|
* While header names are case-insensitive, the casing of the header will |
| 312 |
|
* be preserved by this function, and returned from getHeaders(). |
| 313 |
|
*/ |
| 314 |
|
function it_returns_a_new_request_with_a_header_added_in_a_case_insensitive_way() |
| 315 |
|
{ |
| 316 |
|
$header = "FOO"; |
| 317 |
|
$value = "qux"; |
| 318 |
|
|
| 319 |
|
$request = $this->withAddedHeader($header, $value); |
| 320 |
|
|
| 321 |
|
$request->getHeaderLine("foo")->shouldBe("bar,baz,qux"); |
| 322 |
|
} |
| 323 |
|
|
| 324 |
|
/** |
| 325 |
|
* Existing values for the specified header will be maintained. The new |
|
@@ 356-365 (lines=10) @@
|
| 353 |
|
* immutability of the message, and MUST return an instance that has the |
| 354 |
|
* new and/or updated header and value. |
| 355 |
|
*/ |
| 356 |
|
function it_retains_its_original_header_when_adding_a_header() |
| 357 |
|
{ |
| 358 |
|
$header = "foo"; |
| 359 |
|
$value = "qux"; |
| 360 |
|
|
| 361 |
|
$request = $this->withAddedHeader($header, $value); |
| 362 |
|
|
| 363 |
|
$request->getHeaderLine($header)->shouldReturn("bar,baz,qux"); |
| 364 |
|
$this->getHeaderLine($header)->shouldReturn("bar,baz"); |
| 365 |
|
} |
| 366 |
|
|
| 367 |
|
/** |
| 368 |
|
* Throws \InvalidArgumentException for invalid header names or values. |