本文整理匯總了PHP中Mongo::stop方法的典型用法代碼示例。如果您正苦於以下問題:PHP Mongo::stop方法的具體用法?PHP Mongo::stop怎麽用?PHP Mongo::stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mongo
的用法示例。
在下文中一共展示了Mongo::stop方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testConstruct
/**
* @covers Fabfuel\Prophiler\Adapter\Fabfuel\Mongo::__construct
* @covers Fabfuel\Prophiler\Adapter\Fabfuel\Mongo::start
* @covers Fabfuel\Prophiler\Adapter\Fabfuel\Mongo::stop
* @uses Fabfuel\Prophiler\Profiler
* @uses Fabfuel\Prophiler\Adapter\AdapterAbstract
*/
public function testConstruct()
{
$name = 'foobar';
$metadata = ['lorem' => 'ipsum'];
$benchmark = $this->getMock('\\Fabfuel\\Prophiler\\Benchmark\\BenchmarkInterface');
$identifier = spl_object_hash($benchmark);
$profiler = $this->getMock('Fabfuel\\Prophiler\\Profiler');
$profiler->expects($this->once())->method('start')->with($name, $metadata, 'MongoDB')->will($this->returnValue($benchmark));
$profiler->expects($this->once())->method('stop')->with($benchmark);
$adapter = new Mongo($profiler);
$benchmarkIdentifier = $adapter->start($name, $metadata);
$this->assertSame($benchmarkIdentifier, $identifier);
$adapter->stop($identifier);
}