You are here

private function DbLogTest::getContent in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/dblog/src/Tests/DbLogTest.php \Drupal\dblog\Tests\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 core/modules/dblog/src/Tests/DbLogTest.php
Generates and then verifies some node events.

File

core/modules/dblog/src/Tests/DbLogTest.php, line 444
Contains \Drupal\dblog\Tests\DbLogTest.

Class

DbLogTest
Generate events and verify dblog entries; verify user access to log reports based on permissions.

Namespace

Drupal\dblog\Tests

Code

private function getContent($type) {
  switch ($type) {
    case 'forum':
      $content = array(
        'title[0][value]' => $this
          ->randomMachineName(8),
        'taxonomy_forums' => array(
          1,
        ),
        'body[0][value]' => $this
          ->randomMachineName(32),
      );
      break;
    default:
      $content = array(
        'title[0][value]' => $this
          ->randomMachineName(8),
        'body[0][value]' => $this
          ->randomMachineName(32),
      );
      break;
  }
  return $content;
}