Creates a forum topic.
The title of the newly generated topic.
private function createForumTopics($count = 5) {
$topics = array();
$timestamp = time() - 24 * 60 * 60;
for ($index = 0; $index < $count; $index++) {
// Generate a random subject/body.
$title = $this
->randomName(20);
$body = $this
->randomName(200);
$langcode = LANGUAGE_NOT_SPECIFIED;
$edit = array(
'title' => $title,
"body[{$langcode}][0][value]" => $body,
// Forum posts are ordered by timestamp, so force a unique timestamp by
// adding the index.
'date' => date('c', $timestamp + $index),
);
// Create the forum topic, preselecting the forum ID via a URL parameter.
$this
->drupalPost('node/add/forum/1', $edit, t('Save'));
$topics[] = $title;
}
return $topics;
}