本文整理匯總了PHP中Elasticsearch\Client::expects方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::expects方法的具體用法?PHP Client::expects怎麽用?PHP Client::expects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Elasticsearch\Client
的用法示例。
在下文中一共展示了Client::expects方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCall
/**
* @covers Fabfuel\Prophiler\Decorator\Elasticsearch\ClientDecorator::__call
*/
public function testCall()
{
$payload = ['lorem' => 'ipsum'];
$benchmark = $this->getMock('Fabfuel\\Prophiler\\Benchmark\\BenchmarkInterface');
$this->client->expects($this->once())->method('get')->with($payload);
$this->profiler->expects($this->once())->method('start')->with('ElasticMock::get', [$payload], 'Elasticsearch')->willReturn($benchmark);
$this->profiler->expects($this->once())->method('stop')->with($benchmark);
$this->decorator->get($payload);
}
示例2: testMethodIndices
/**
* Tests the indices method.
*/
public function testMethodIndices()
{
$output = [];
$this->client->expects($this->any())->method('indices')->will($this->returnValue($output));
$this->specify('method indices is ran', function () use($output) {
verify($this->service->indices())->equals($output);
});
}