本文整理汇总了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());
}
示例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]);
}
示例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);
}
示例4: testLog
public function testLog()
{
$this->console->expects($this->once())->method('writeln')->with('<detail>Detail message.</detail>');
$this->consoleLoggerModel->log('Detail message.');
}