1.20.x dblog.test private DBLogTestCase::getContent($type)

Creates random content based on node content type.

Parameters

string $type: Node content type (e.g., 'post').

Return value

array: Random content needed by various node types.

File

modules/dblog/tests/dblog.test, line 380
Tests for dblog.module.

Class

DBLogTestCase
Tests logging messages to the database.

Code

private function getContent($type) {
  $langcode = LANGUAGE_NONE;
  switch ($type) {
    case 'book':
      $content = array(
        "title" => $this->randomName(8),
        "body[$langcode][0][value]" => $this->randomName(32),
      );
      break;

    default:
      $content = array(
        "title" => $this->randomName(8),
        "body[$langcode][0][value]" => $this->randomName(32),
      );
      break;
  }
  return $content;
}