本文整理汇总了PHP中Connector::log方法的典型用法代码示例。如果您正苦于以下问题:PHP Connector::log方法的具体用法?PHP Connector::log怎么用?PHP Connector::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connector
的用法示例。
在下文中一共展示了Connector::log方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_log
public function test_log()
{
$percent_failure = 100;
$hours_remaining = 72;
$message = 'I\'ve just picked up a fault in the AE35 unit. It\'s going to go %1$s%% failure in %2$s hours.';
$this->connector->log($message, array($percent_failure, $hours_remaining), null, 'ae35', 'simulate_fault', get_current_user_id());
global $wpdb;
$result = $wpdb->get_row("SELECT * FROM {$wpdb->stream} ORDER BY created DESC LIMIT 1");
$this->assertNotEmpty($result);
$this->assertEquals(sprintf($message, $percent_failure, $hours_remaining), $result->summary);
$this->assertEquals('maintenance', $result->connector);
$this->assertEquals('ae35', $result->context);
$this->assertEquals('simulate_fault', $result->action);
}