You are here

private function MongoDBLogTestCase::getContent in MongoDB 7

Same name and namespace in other branches
  1. 8 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::getContent()
  2. 6 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::getContent()

Create content based on content type.

Parameters

string $type: Content type.

Return value

array Content.

1 call to MongoDBLogTestCase::getContent()
MongoDBLogTestCase::doNode in mongodb_watchdog/mongodb_watchdog.test
Generate and verify node events.

File

mongodb_watchdog/mongodb_watchdog.test, line 500
Contains \MongoDBLogTestCase.

Class

MongoDBLogTestCase

Code

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