public function testItRetriesTheMessage() { $delayExchange =
$this->
createMock(\AMQPExchange::
class);
$delayExchange->
expects($this->
once()) ->
method('publish'
) ->
with('{}', 'delay_messages__5000_retry', \AMQP_NOPARAM
);
$connection =
$this->
createDelayOrRetryConnection($delayExchange, '', 'delay_messages__5000_retry'
);
$amqpEnvelope =
$this->
createMock(\AMQPEnvelope::
class);
$amqpStamp = AmqpStamp::
createFromAmqpEnvelope($amqpEnvelope, null, ''
);
$connection->
publish('{}',
[], 5000,
$amqpStamp);
} public function testItDelaysTheMessageWithADifferentRoutingKeyAndTTLs() { $amqpConnection =
$this->
createMock(\AMQPConnection::
class);
$amqpChannel =
$this->
createMock(\AMQPChannel::
class);
$factory =
$this->
createMock(AmqpFactory::
class);
$factory->
method('createConnection'
)->
willReturn($amqpConnection);
$factory->
method('createChannel'
)->
willReturn($amqpChannel);