|
@@ 93-100 (lines=8) @@
|
| 90 |
|
$this->assertEquals('/', $r1->getRequestTarget()); |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
public function testRequestTargetDoesNotAllowSpaces() |
| 94 |
|
{ |
| 95 |
|
$this->expectException(\InvalidArgumentException::class); |
| 96 |
|
$this->expectExceptionMessage('Invalid request target provided; cannot contain whitespace'); |
| 97 |
|
|
| 98 |
|
$r1 = new Request('GET', '/'); |
| 99 |
|
$r1->withRequestTarget('/foo bar'); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
public function testRequestTargetDefaultsToSlash() |
| 103 |
|
{ |
|
@@ 190-196 (lines=7) @@
|
| 187 |
|
$this->assertEquals('foo.com:8125', $r->getHeaderLine('host')); |
| 188 |
|
} |
| 189 |
|
|
| 190 |
|
public function testCannotHaveHeaderWithEmptyName() |
| 191 |
|
{ |
| 192 |
|
$this->expectException(\InvalidArgumentException::class); |
| 193 |
|
$this->expectExceptionMessage('Header name must be an RFC 7230 compatible string.'); |
| 194 |
|
$r = new Request('GET', 'https://example.com/'); |
| 195 |
|
$r = $r->withHeader('', 'Bar'); |
| 196 |
|
} |
| 197 |
|
|
| 198 |
|
public function testCanHaveHeaderWithEmptyValue() |
| 199 |
|
{ |