当前位置: 首页>>代码示例>>PHP>>正文


PHP Logger::expects方法代码示例

本文整理汇总了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'));
 }
开发者ID:Banjerr,项目名称:infusionWholesaler,代码行数:14,代码来源:MonologTimerBridgeTest.php

示例2: withLogError

 protected function withLogError()
 {
     $this->mockLogger->expects($this->once())->method('error')->withAnyParameters()->willReturn(true);
 }
开发者ID:synapsestudios,项目名称:synapse-files,代码行数:4,代码来源:AbstractFileControllerTest.php

示例3: setNoOpExpectation

 protected function setNoOpExpectation()
 {
     $this->logger->expects($this->never())->method(new \PHPUnit_Framework_Constraint_IsAnything());
 }
开发者ID:uecode,项目名称:qpush-bundle,代码行数:4,代码来源:CustomProviderTest.php


注:本文中的Monolog\Logger::expects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。