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); }