public function testReason()
 {
     $obj = new UndeleteOptions();
     $this->assertEquals('', $obj->getReason());
     $this->assertEquals($obj, $obj->setReason('foo'));
     $this->assertEquals('foo', $obj->getReason());
 }
Example #2
0
 /**
  * @param Title $title
  * @param UndeleteOptions|null $options
  *
  * @return array
  */
 private function getUndeleteParams(Title $title, $options)
 {
     $params = array();
     $reason = $options->getReason();
     if (!empty($reason)) {
         $params['reason'] = $reason;
     }
     $params['title'] = $title->getTitle();
     $params['token'] = $this->getUndeleteToken($title);
     return $params;
 }