Skip to content

Commit be39936

Browse files
renqMichal LipekMichał Lipek
authored
Stop keeping messages in unacked state (#10)
* Stop keeping messages in unacked state * For backward compatibility, method seeMessageInQueueContainsText consumes the message instead of returning it Co-authored-by: Michal Lipek <[email protected]> Co-authored-by: Michał Lipek <[email protected]>
1 parent b54959e commit be39936

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Codeception/Module/AMQP.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ public function seeMessageInQueueContainsText($queue, $text)
310310
}
311311
$this->debugSection("Message", $msg->body);
312312
$this->assertStringContainsString($text, $msg->body);
313+
314+
$msg->ack();
313315
}
314316

315317
/**

tests/unit/Codeception/Module/AMQPTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function testPushToQueue()
3737
{
3838
$this->module->pushToQueue('queue1', 'hello');
3939
$this->module->seeMessageInQueueContainsText('queue1', 'hello');
40+
$this->module->seeQueueIsEmpty('queue1');
4041
}
4142

4243
public function testCountQueue()

0 commit comments

Comments
 (0)