本文整理匯總了PHP中Monolog\Logger::expects方法的典型用法代碼示例。如果您正苦於以下問題:PHP Logger::expects方法的具體用法?PHP Logger::expects怎麽用?PHP Logger::expects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Monolog\Logger
的用法示例。
在下文中一共展示了Logger::expects方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testSpecifyingLoggingThresholds
public function testSpecifyingLoggingThresholds()
{
$bridge = new MonologTimerBridge($this->monolog, array(1 => Logger::DEBUG, 2 => Logger::WARNING, '3.5' => Logger::ALERT));
$this->monolog->expects($this->at(0))->method('addRecord')->with(Logger::DEBUG, 'fXmlRpc call took 0.1000000000s', array('xmlrpcMethod' => 'method', 'xmlrpcArguments' => array('arg1', 'arg2')));
$this->monolog->expects($this->at(1))->method('addRecord')->with(Logger::DEBUG, 'fXmlRpc call took 1.1000000000s', array('xmlrpcMethod' => 'method', 'xmlrpcArguments' => array('arg1', 'arg2')));
$this->monolog->expects($this->at(2))->method('addRecord')->with(Logger::WARNING, 'fXmlRpc call took 2.5000000000s', array('xmlrpcMethod' => 'method', 'xmlrpcArguments' => array('arg1', 'arg2')));
$this->monolog->expects($this->at(3))->method('addRecord')->with(Logger::ALERT, 'fXmlRpc call took 3.5000000000s', array('xmlrpcMethod' => 'method', 'xmlrpcArguments' => array('arg1', 'arg2')));
$this->monolog->expects($this->at(4))->method('addRecord')->with(Logger::ALERT, 'fXmlRpc call took 5.5000000000s', array('xmlrpcMethod' => 'method', 'xmlrpcArguments' => array('arg1', 'arg2')));
$bridge->recordTiming(0.1, 'method', array('arg1', 'arg2'));
$bridge->recordTiming(1.1, 'method', array('arg1', 'arg2'));
$bridge->recordTiming(2.5, 'method', array('arg1', 'arg2'));
$bridge->recordTiming(3.5, 'method', array('arg1', 'arg2'));
$bridge->recordTiming(5.5, 'method', array('arg1', 'arg2'));
}
示例2: withLogError
protected function withLogError()
{
$this->mockLogger->expects($this->once())->method('error')->withAnyParameters()->willReturn(true);
}
示例3: setNoOpExpectation
protected function setNoOpExpectation()
{
$this->logger->expects($this->never())->method(new \PHPUnit_Framework_Constraint_IsAnything());
}