/** * Testing send message without errors * * @dataProvider providerAddMessageParameters */ public function testAddMessage($routingKey, $publishFlag, $publishParameters) { $message = new Message(); $message->setDeviceToken(str_repeat('af', 32))->setBody('Foo bar'); $messageSerialized = serialize($message); $this->exchange->expects($this->once())->method('publish')->with($messageSerialized, $routingKey, $publishFlag, $publishParameters)->will($this->returnValue(true)); $adapter = new AmqpAdapter(); $adapter->setExchange($this->exchange)->setRoutingKey($routingKey)->setPublishOptions($publishParameters)->setPublishFlag($publishFlag); $adapter->addMessage($message); }
/** * Asserts that calls to unknown methods are proxied through to the * exchange object. * * @param string $method Method name * @param string $arg Arg to pass * * @dataProvider CallProvider */ public function test__call($method, $arg) { $this->exchange->expects($this->once())->method($method)->with($arg); $producer = new Producer($this->exchange, $this->loop, 1); $producer->{$method}($arg); }