本文整理匯總了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);
}