private function DBLogTest::getContent

Creates random content based on node content type.

Parameters

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

Return value

array Random content needed by various node types.

1 call to DBLogTest::getContent()
DBLogTest::doNode in drupal/core/modules/dblog/lib/Drupal/dblog/Tests/DBLogTest.php
Generates and then verifies some node events.

File

drupal/core/modules/dblog/lib/Drupal/dblog/Tests/DBLogTest.php, line 369
Definition of Drupal\dblog\Tests\DBLogTest.

Class

DBLogTest
Tests logging messages to the database.

Namespace

Drupal\dblog\Tests

Code

private function getContent($type) {
  $langcode = LANGUAGE_NOT_SPECIFIED;
  switch ($type) {
    case 'poll':
      $content = array(
        "title" => $this
          ->randomName(8),
        'choice[new:0][chtext]' => $this
          ->randomName(32),
        'choice[new:1][chtext]' => $this
          ->randomName(32),
      );
      break;
    default:
      $content = array(
        "title" => $this
          ->randomName(8),
        "body[{$langcode}][0][value]" => $this
          ->randomName(32),
      );
      break;
  }
  return $content;
}