Skip to content

Commit dcab200

Browse files
committed
Allow pushToEchange to accept routing key to send to exchanges
include param description and sample use
1 parent 08fb719 commit dcab200

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Codeception/Module/AMQP.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,22 @@ public function _before(\Codeception\TestCase $test)
102102
}
103103

104104
/**
105-
* Sends message to exchange
106-
*
105+
* Sends message to exchange by sending exchange name, message
106+
* and (optionally) a routing key
107+
*
107108
* ``` php
108109
* <?php
109110
* $I->pushToExchange('exchange.emails', 'thanks');
110111
* $I->pushToExchange('exchange.emails', new AMQPMessage('Thanks!'));
112+
* $I->pushToExchange('exchange.emails', new AMQPMessage('Thanks!'), 'severity');
111113
* ?>
112114
* ```
113115
*
114116
* @param $exchange
115117
* @param $message string|AMQPMessage
118+
* @param $routing_key
116119
*/
117-
public function pushToExchange($exchange, $message, $routing_key)
120+
public function pushToExchange($exchange, $message, $routing_key = null)
118121
{
119122
$message = $message instanceof AMQPMessage
120123
? $message

0 commit comments

Comments
 (0)