本文整理汇总了PHP中AMQPExchange::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP AMQPExchange::expects方法的具体用法?PHP AMQPExchange::expects怎么用?PHP AMQPExchange::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMQPExchange
的用法示例。
在下文中一共展示了AMQPExchange::expects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddMessage
/**
* 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);
}
示例2: test__call
/**
* 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);
}