本文整理汇总了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());
}