|
@@ 72-87 (lines=16) @@
|
| 69 |
|
$this->assertInstanceOf('\Psr\Http\Message\ResponseInterface', $response); |
| 70 |
|
} |
| 71 |
|
|
| 72 |
|
public function testInvokeWillGenerateNewId() |
| 73 |
|
{ |
| 74 |
|
// Arrange |
| 75 |
|
$this->generatorMock->expects($this->once())->method('create')->will($this->returnValue(static::TEST_ID)); |
| 76 |
|
$this->requestMock->expects($this->once())->method('withHeader')->will($this->returnSelf()); |
| 77 |
|
$this->requestMock->expects($this->once())->method('getHeaderLine')->will($this->returnValue(null)); |
| 78 |
|
$this->responseMock->expects($this->once())->method('withHeader')->will($this->returnSelf()); |
| 79 |
|
// Act |
| 80 |
|
$response = call_user_func_array($this->sut, [ |
| 81 |
|
$this->requestMock, |
| 82 |
|
$this->responseMock, |
| 83 |
|
$this->getFakeNextCallable() |
| 84 |
|
]); |
| 85 |
|
// Assert |
| 86 |
|
$this->assertInstanceOf('\Psr\Http\Message\ResponseInterface', $response); |
| 87 |
|
} |
| 88 |
|
|
| 89 |
|
public function testInvokeFetchesIdFromRequest() |
| 90 |
|
{ |
|
@@ 89-105 (lines=17) @@
|
| 86 |
|
$this->assertInstanceOf('\Psr\Http\Message\ResponseInterface', $response); |
| 87 |
|
} |
| 88 |
|
|
| 89 |
|
public function testInvokeFetchesIdFromRequest() |
| 90 |
|
{ |
| 91 |
|
// Arrange |
| 92 |
|
$this->generatorMock->expects($this->never())->method('create')->will($this->returnValue(static::TEST_ID)); |
| 93 |
|
$this->requestMock->expects($this->once())->method('withHeader')->will($this->returnSelf()); |
| 94 |
|
$this->requestMock->expects($this->once())->method('getHeaderLine') |
| 95 |
|
->will($this->returnValue(static::TEST_ID)); |
| 96 |
|
$this->responseMock->expects($this->once())->method('withHeader')->will($this->returnSelf()); |
| 97 |
|
// Act |
| 98 |
|
$response = call_user_func_array($this->sut, [ |
| 99 |
|
$this->requestMock, |
| 100 |
|
$this->responseMock, |
| 101 |
|
$this->getFakeNextCallable() |
| 102 |
|
]); |
| 103 |
|
// Assert |
| 104 |
|
$this->assertInstanceOf('\Psr\Http\Message\ResponseInterface', $response); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
public function testInvokeFetchesIdFromCustomHeaderKey() |
| 108 |
|
{ |