You are here

function _notifications_content_test_generate_content in Notifications 6.4

Same name and namespace in other branches
  1. 7 notifications_content/notifications_content.admin.inc \_notifications_content_test_generate_content()

Generate fake node or comment

1 call to _notifications_content_test_generate_content()
notifications_content_test_template_submit in notifications_content/notifications_content.pages.inc
Process template test

File

notifications_content/notifications_content.pages.inc, line 169
Subscriptions to content events

Code

function _notifications_content_test_generate_content($type) {
  $node = new Stdclass();
  $title = t('Test title for @type', array(
    '@type' => $type,
  ));
  for ($i = 1; $i <= 5; $i++) {
    $body[] = t('Test body line @number for @type.', array(
      '@number' => $i,
      '@type' => $type,
    ));
  }
  if ($type == 'comment') {
    $node->subject = $title;
    $node->comment = implode("\n", $body);
  }
  else {
    $node->title = $title;
    $node->body = implode("\n", $body);
    $node->teaser = node_teaser($node->body);
  }
  return $node;
}