|
6 | 6 | use Enqueue\Consumption\Context; |
7 | 7 | use Enqueue\Consumption\Context\MessageReceived; |
8 | 8 | use Enqueue\Consumption\Context\MessageResult; |
| 9 | +use Enqueue\Consumption\Context\PostConsume; |
9 | 10 | use Enqueue\Consumption\Context\PostMessageReceived; |
10 | 11 | use Enqueue\Consumption\Context\PreConsume; |
11 | 12 | use Enqueue\Consumption\Context\PreSubscribe; |
@@ -36,7 +37,7 @@ public function testCouldBeConstructedWithExtensionsArray() |
36 | 37 |
|
37 | 38 | public function testShouldProxyOnStartToAllInternalExtensions() |
38 | 39 | { |
39 | | - $context = new Start($this->createInteropContextMock(), $this->createLoggerMock(), [], 0, 0, 0); |
| 40 | + $context = new Start($this->createInteropContextMock(), $this->createLoggerMock(), [], 0, 0); |
40 | 41 |
|
41 | 42 | $fooExtension = $this->createExtension(); |
42 | 43 | $fooExtension |
@@ -196,26 +197,33 @@ public function testShouldProxyOnPostReceiveToAllInternalExtensions() |
196 | 197 | $extensions->onPostMessageReceived($context); |
197 | 198 | } |
198 | 199 |
|
199 | | - public function testShouldProxyOnIdleToAllInternalExtensions() |
| 200 | + public function testShouldProxyOnPostConsumeToAllInternalExtensions() |
200 | 201 | { |
201 | | - $context = $this->createContextMock(); |
| 202 | + $postConsume = new PostConsume( |
| 203 | + $this->createInteropContextMock(), |
| 204 | + $this->createSubscriptionConsumerMock(), |
| 205 | + 1, |
| 206 | + 1, |
| 207 | + 1, |
| 208 | + new NullLogger() |
| 209 | + ); |
202 | 210 |
|
203 | 211 | $fooExtension = $this->createExtension(); |
204 | 212 | $fooExtension |
205 | 213 | ->expects($this->once()) |
206 | | - ->method('onIdle') |
207 | | - ->with($this->identicalTo($context)) |
| 214 | + ->method('onPostConsume') |
| 215 | + ->with($this->identicalTo($postConsume)) |
208 | 216 | ; |
209 | 217 | $barExtension = $this->createExtension(); |
210 | 218 | $barExtension |
211 | 219 | ->expects($this->once()) |
212 | | - ->method('onIdle') |
213 | | - ->with($this->identicalTo($context)) |
| 220 | + ->method('onPostConsume') |
| 221 | + ->with($this->identicalTo($postConsume)) |
214 | 222 | ; |
215 | 223 |
|
216 | 224 | $extensions = new ChainExtension([$fooExtension, $barExtension]); |
217 | 225 |
|
218 | | - $extensions->onIdle($context); |
| 226 | + $extensions->onPostConsume($postConsume); |
219 | 227 | } |
220 | 228 |
|
221 | 229 | public function testShouldProxyOnInterruptedToAllInternalExtensions() |
|
0 commit comments