Esempio n. 1
0
 /**
  * Detects bugs, associated with each commit from a given revision range.
  *
  * @param integer $from_revision      From revision.
  * @param integer $to_revision        To revision.
  * @param array   $bug_regexp_mapping Mapping between project and it's "BugRegExp" field.
  *
  * @return void
  */
 protected function doDetectBugs($from_revision, $to_revision, array $bug_regexp_mapping)
 {
     $commits_by_project = $this->getCommitsGroupedByProject($from_revision, $to_revision);
     foreach ($commits_by_project as $project_id => $project_commits) {
         if (!isset($bug_regexp_mapping[$project_id])) {
             continue;
         }
         $log_message_parser = $this->_logMessageParserFactory->getLogMessageParser($bug_regexp_mapping[$project_id]);
         foreach ($project_commits as $revision => $log_message) {
             $bugs = $log_message_parser->parse($log_message);
             if ($bugs) {
                 $this->repositoryFiller->addBugsToCommit($bugs, $revision);
                 $this->recordStatistic(self::STATISTIC_BUG_ADDED_TO_COMMIT, count($bugs));
             }
         }
     }
 }
 public function testSameParserForSameInput()
 {
     $parser1 = $this->logMessageParserFactory->getLogMessageParser('.*');
     $parser2 = $this->logMessageParserFactory->getLogMessageParser('.*');
     $this->assertSame($parser1, $parser2);
 }