當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。