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


PHP PHPUnit_Framework_MockObject_MockObject::log方法代码示例

本文整理汇总了PHP中PHPUnit_Framework_MockObject_MockObject::log方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_MockObject_MockObject::log方法的具体用法?PHP PHPUnit_Framework_MockObject_MockObject::log怎么用?PHP PHPUnit_Framework_MockObject_MockObject::log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_Framework_MockObject_MockObject的用法示例。


在下文中一共展示了PHPUnit_Framework_MockObject_MockObject::log方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testLogComplex

 public function testLogComplex()
 {
     $this->expectOutputRegex('/Array\\s\\(\\s+\\[0\\] => 1\\s\\).+stdClass Object/s');
     $this->_model->addStreamLog(Mage_Core_Model_Logger::LOGGER_SYSTEM, 'php://output');
     $this->_model->log(array(1));
     $this->_model->log(new StdClass());
 }
开发者ID:nickimproove,项目名称:magento2,代码行数:7,代码来源:LoggerTest.php

示例2: logFormatsDetailMessageWithAdditionalDataInLocalErrorArray

 /**
  * @test
  */
 public function logFormatsDetailMessageWithAdditionalDataInLocalErrorArray()
 {
     $backendUser = $this->getMock(BackendUserAuthentication::class);
     $this->subject->BE_USER = $backendUser;
     $this->subject->enableLogging = TRUE;
     $this->subject->errorLog = array();
     $logDetails = $this->getUniqueId('details');
     $this->subject->log('', 23, 0, 42, 1, '%1$s' . $logDetails . '%2$s', -1, array('foo', 'bar'));
     $expected = 'foo' . $logDetails . 'bar';
     $this->assertStringEndsWith($expected, $this->subject->errorLog[0]);
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:14,代码来源:DataHandlerTest.php

示例3: logParsesContextWithoutException

 /**
  * @test
  */
 public function logParsesContextWithoutException()
 {
     $context = ['foo' => 'bar'];
     $message = 'foobar';
     $logLevel = LogLevel::INFO;
     // Bit of a stretch to check for the exception trace and all, just check the general format and contents
     $argumentCheckCallback = function ($arg) use($message, $context) {
         $pattern = sprintf('/^%s \\/ Context\\: %s/', $message, json_encode($context));
         return preg_match($pattern, $arg) === 1;
     };
     $this->logger->expects(self::once())->method('format')->with($logLevel, self::callback($argumentCheckCallback))->will(self::returnValue($message));
     $this->logger->expects(self::once())->method('output')->with($message);
     $this->logger->log($logLevel, $message, $context);
 }
开发者ID:AuronConsultingOSS,项目名称:PhpConsoleLogger,代码行数:17,代码来源:ConsoleTest.php

示例4: testLog

 public function testLog()
 {
     $this->console->expects($this->once())->method('writeln')->with('<detail>Detail message.</detail>');
     $this->consoleLoggerModel->log('Detail message.');
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:5,代码来源:ConsoleLoggerTest.php


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