You are here

private function MongoDBLogTestCase::getContentUpdate in MongoDB 7

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

Create content update based on content type.

Parameters

string $type: Content type.

Return value

array Content.

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

File

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

Class

MongoDBLogTestCase

Code

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