public function testSetQosCountInChannel() { $this->channelMock->expects($this->once())->method('setPrefetchCount')->with($this->equalTo(3)); $c = new Consumer($this->channelMock, $this->queueMock); $c->setQueueOptions(['name' => 'myQueue', 'binding' => ['name' => 'testName', 'routing-keys' => 'testKey'], 'qos_count' => 3]); $c->consume(function () { }); }
protected function createConsumer($name) { $conf = $this->config['consumers'][$name]; $conn = $this->connFactory->getConnection($conf['connection']); $consumer = new Consumer(new AMQPChannel($conn)); $consumer->setQueueOptions($conf['queue_options']); $this->consumers[$name] = $consumer; return $consumer; }