$factory =
new TestAmqpFactory( $this->
createMock(\AMQPConnection::
class),
$this->
createMock(\AMQPChannel::
class),
$this->
createMock(\AMQPQueue::
class),
$amqpExchange =
$this->
createMock(\AMQPExchange::
class) );
$amqpExchange->
expects($this->
once())->
method('publish'
)->
with('body', null, \AMQP_NOPARAM,
['headers' =>
['Foo' => 'X', 'Bar' => 'Y'
], 'delivery_mode' => 2, 'timestamp' =>
time()]);
$connection = Connection::
fromDsn('amqp://localhost',
[],
$factory);
$connection->
publish('body',
['Foo' => 'X'
], 0,
new AmqpStamp(null, \AMQP_NOPARAM,
['headers' =>
['Bar' => 'Y'
]]));
} public function testAmqpStampDeliveryModeIsUsed() { $factory =
new TestAmqpFactory( $this->
createMock(\AMQPConnection::
class),
$this->
createMock(\AMQPChannel::
class),
$this->
createMock(\AMQPQueue::
class),
$amqpExchange =
$this->
createMock(\AMQPExchange::
class) );