public function itCachesResultsToSaveTheRainForestAndKittens()
 {
     expect($this->dao)->searchByArtifactId()->once();
     $this->retriever->getRawMailThatCreatedArtifact($this->artifact_by_mail);
     $this->retriever->getRawMailThatCreatedChangeset($this->changeset_by_mail);
     $this->retriever->getRawMailThatCreatedChangeset($this->other_changeset_by_mail);
 }
 public static function instance()
 {
     if (!isset(self::$instance)) {
         $c = __CLASS__;
         self::$instance = new $c(new Tracker_Artifact_Changeset_IncomingMailDao());
     }
     return self::$instance;
 }
 private function fetchIncomingMailButton()
 {
     if (!$this->getUserManager()->getCurrentUser()->isSuperUser()) {
         return '';
     }
     $retriever = Tracker_Artifact_Changeset_IncomingMailGoldenRetriever::instance();
     $raw_mail = $retriever->getRawMailThatCreatedChangeset($this);
     if (!$raw_mail) {
         return '';
     }
     $raw_email_button_title = $GLOBALS['Language']->getText('plugin_tracker', 'raw_email_button_title');
     $raw_mail = Codendi_HTMLPurifier::instance()->purify($raw_mail);
     $html = '<button type="button" class="btn btn-mini tracker_artifact_followup_comment_controls_raw_email" data-raw-email="' . $raw_mail . '">
                   <i class="icon-envelope"></i> ' . $raw_email_button_title . '
              </button>';
     return $html;
 }