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 371
Contains \Drupal\dblog\Tests\DbLogTest.

Class

DbLogTest
Tests logging messages to the database.

Namespace

Drupal\dblog\Tests

Code

private function getContent($type) {
  $langcode = Language::LANGCODE_NOT_SPECIFIED;
  switch ($type) {
    case 'forum':
      $content = array(
        "title" => $this
          ->randomName(8),
        "taxonomy_forums[{$langcode}]" => array(
          1,
        ),
        "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;
}