| @@ 66-75 (lines=10) @@ | ||
| 63 | /** |
|
| 64 | * Test nack with requeue |
|
| 65 | */ |
|
| 66 | public function testNack() |
|
| 67 | { |
|
| 68 | $data = json_encode(['bar' => 'baz']); |
|
| 69 | $message = $this->prophesize('Swarrot\Broker\Message'); |
|
| 70 | $message->getBody()->willReturn($data); |
|
| 71 | ||
| 72 | $this->redis->lPush($this->queueName, $data)->shouldBeCalled(); |
|
| 73 | ||
| 74 | $this->provider->nack($message->reveal(), true); |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * Test nack with requeue |
|
| @@ 80-89 (lines=10) @@ | ||
| 77 | /** |
|
| 78 | * Test nack with requeue |
|
| 79 | */ |
|
| 80 | public function testNackWithNoRequeue() |
|
| 81 | { |
|
| 82 | $data = json_encode(['bar' => 'baz']); |
|
| 83 | $message = $this->prophesize('Swarrot\Broker\Message'); |
|
| 84 | $message->getBody()->willReturn($data); |
|
| 85 | ||
| 86 | $this->redis->lPush($this->queueName, $data)->shouldNotBeCalled(); |
|
| 87 | ||
| 88 | $this->provider->nack($message->reveal(), false); |
|
| 89 | } |
|
| 90 | } |
|
| 91 | ||