コード例 #1
0
 public function testGetMessageKey()
 {
     $summary = new Summary('summarytest');
     $this->assertEquals("summarytest", $summary->getMessageKey());
     $summary->setAction("testing");
     $this->assertEquals("summarytest-testing", $summary->getMessageKey());
     $summary->setModuleName("");
     $this->assertEquals("testing", $summary->getMessageKey());
 }
コード例 #2
0
 /**
  * Format the autocomment part of a full summary. Note that the first argument is always the
  * number of summary arguments supplied via addAutoSummaryArgs() (or the constructor),
  * and the second one is always the language code supplied via setLanguage()
  * (or the constructor).
  *
  * @since 0.5
  *
  * @param Summary $summary
  *
  * @return string with a formatted comment, or possibly an empty string
  */
 public function formatAutoComment(Summary $summary)
 {
     $composite = $summary->getMessageKey();
     $summaryArgCount = count($summary->getAutoSummaryArgs());
     $commentArgs = array_merge(array($summaryArgCount, $summary->getLanguageCode()), $summary->getCommentArgs());
     //XXX: we might want to use different formatters for autocomment and summary.
     $parts = $this->formatArgList($commentArgs);
     $joinedParts = implode('|', $parts);
     if ($joinedParts !== '') {
         $composite .= ':' . $joinedParts;
     }
     return $composite;
 }