Skip to content

Commit

Permalink
Fix phpunit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Teyssier committed Jul 7, 2016
1 parent e1d11e9 commit f7286dd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 30 deletions.
41 changes: 17 additions & 24 deletions src/ConsumerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,50 @@

interface ConsumerInterface
{

/**
* Consumer tag to listen message
* By default you can set it to ''
* By default you can set it to ''.
*/
public function getConsumerTag();

/**
* No local to listen message
* By default you can set it to false
* By default you can set it to false.
*/
public function getNoLocal();

/**
* No ack to listen message. RabbitMq remove the message only if an ack is send
* By default you can set it to false
* By default you can set it to false.
*/
public function getNoAck();

/**
* Exclusive to listen message
* By default you can set it to false
* By default you can set it to false.
*/
public function getExclusive();

/**
* No wait to listen message
* By default you can set it to false
* By default you can set it to false.
*/
public function getNoWait();

/**
* Callback for the consume service call if a mesage is receive
*/
public function callback();


/**
* Ticket to listen message
* By default you can set it to null
* Callback for the consume service call if a mesage is receive.
*/
public function getNoWait();
public function callback();

/**
* Argument to listen message
* By default you can set it to []
* By default you can set it to [].
*/
public function getArguments();

/**
* Argument to listen message
* By default you can set it to []
* Tiket to listen message
* By default you can set it to [].
*/
public function getTicket();
}
4 changes: 2 additions & 2 deletions src/Objects/Binding.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function __construct(Exchange $source, Queue $to)
public function init(AMQPChannel $amqpChannel)
{
if (!$this->init) {
$this->source->init();
$this->to->init();
$this->source->init($amqpChannel);
$this->to->init($amqpChannel);

$amqpChannel->queue_bind($this->to->getName(),
$this->source->getName(),
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function init(AMQPChannel $amqpChannel)
$this->type,
$this->passive,
$this->durable,
$this->auto_delete,
$this->autoDelete,
$this->internal,
$this->nowait,
$this->arguments,
Expand Down
6 changes: 3 additions & 3 deletions src/Objects/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Mouf\AmqpClient\RabbitMqObjectInterface;
use PhpAmqpLib\Channel\AMQPChannel;
use Mouf\AmqpClient\ConsumerInterface;
use Mouf\AmqpClient\Client;

/**
* @author Marc
Expand Down Expand Up @@ -499,8 +498,9 @@ public function setMaxPriority($maxPriority)
public function init(AMQPChannel $amqpChannel)
{
if (!$this->init) {
$this->source->init($amqpChannel);
$this->deadLetterQueue->init($amqpChannel);
if ($this->deadLetterQueue) {
$this->deadLetterQueue->init($amqpChannel);
}

$parameters = [];
if ($this->alternateExchange !== null) {
Expand Down

0 comments on commit f7286dd

Please sign in to comment.