/**
  * @param string $action
  * @param AbstractRevision|null $parent
  * @param array $overrides
  * @return PostRevision
  */
 public function generateRevision($action, AbstractRevision $parent = null, array $overrides = array())
 {
     $overrides['rev_change_type'] = $action;
     if ($parent) {
         $overrides['rev_parent_id'] = $parent->getRevisionId()->getBinary();
         $overrides['tree_rev_descendant_id'] = $parent->getPostId()->getBinary();
         $overrides['rev_type_id'] = $parent->getPostId()->getBinary();
     }
     switch ($action) {
         case 'restore-post':
             $overrides += array('rev_mod_state' => $this->moderation[$action], 'rev_mod_user_id' => null, 'rev_mod_user_ip' => null, 'rev_mod_timestamp' => null, 'rev_mod_reason' => 'unit test');
             break;
         case 'hide-post':
         case 'delete-post':
         case 'suppress-post':
             $overrides += array('rev_mod_state' => $this->moderation[$action], 'rev_mod_user_id' => 1, 'rev_mod_user_ip' => null, 'rev_mod_timestamp' => wfTimestampNow(), 'rev_mod_reason' => 'unit test');
             break;
         default:
             // nothing special
             break;
     }
     $revision = $this->generateObject($overrides);
     $this->store($revision);
     return $revision;
 }