| @@ 10-19 (lines=10) @@ | ||
| 7 | ||
| 8 | class CsrfHeaderCheckMiddlewareFactoryTest extends AbstractMiddlewareTest |
|
| 9 | { |
|
| 10 | public function testFactory() |
|
| 11 | { |
|
| 12 | $request = new ServerRequest([], [], "http://alice.com/hello", "Get"); |
|
| 13 | ||
| 14 | $middleware = CsrfHeaderCheckMiddlewareFactory::createDefault(); |
|
| 15 | ||
| 16 | $response = $middleware->process($request, $this->getDelegate()); |
|
| 17 | ||
| 18 | $this->assertSame('foobar', (string) $response->getBody()); |
|
| 19 | } |
|
| 20 | } |
|
| 21 | ||
| @@ 17-27 (lines=11) @@ | ||
| 14 | ||
| 15 | class CsrfHeaderCheckMiddlewareTest extends AbstractMiddlewareTest |
|
| 16 | { |
|
| 17 | public function testGetRequest() |
|
| 18 | { |
|
| 19 | $request = new ServerRequest([], [], "http://alice.com/hello", "Get"); |
|
| 20 | ||
| 21 | $middleware = CsrfHeaderCheckMiddlewareFactory::createDefault(); |
|
| 22 | ||
| 23 | ||
| 24 | $response = $middleware->process($request, $this->getDelegate()); |
|
| 25 | ||
| 26 | $this->assertSame('foobar', (string) $response->getBody()); |
|
| 27 | } |
|
| 28 | ||
| 29 | public function testFailingPostRequestNoHost() |
|
| 30 | { |
|