Skip to content

Commit 373143f

Browse files
committed
add ability to customize message
1 parent 604a1c1 commit 373143f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/SendAndReceivePriorityMessagesFromQueueSpec.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public function test()
4242
$producer = $context->createProducer();
4343

4444
$producer->setPriority(1);
45-
$producer->send($queue, $context->createMessage($expectedPriority1Body));
45+
$producer->send($queue, $this->createMessage($context, $expectedPriority1Body));
4646

4747
$producer->setPriority(5);
48-
$producer->send($queue, $context->createMessage($expectedPriority5Body));
48+
$producer->send($queue, $this->createMessage($context, $expectedPriority5Body));
4949

5050
$message = $consumer->receive(8000); // 8 sec
5151

@@ -65,6 +65,17 @@ public function test()
6565
*/
6666
abstract protected function createContext();
6767

68+
/**
69+
* @param PsrContext $context
70+
* @param string $body
71+
*
72+
* @return PsrMessage
73+
*/
74+
protected function createMessage(PsrContext $context, $body)
75+
{
76+
return $context->createMessage($body);
77+
}
78+
6879
/**
6980
* @param PsrContext $context
7081
* @param string $queueName

0 commit comments

Comments
 (0)