Esempio n. 1
0
 /**
  * @return Tracker_ArtifactByEmailStatus
  */
 private function canUpdateArtifactByMail()
 {
     $config = new TrackerPluginConfig(new TrackerPluginConfigDao());
     $status = new Tracker_ArtifactByEmailStatus($config);
     return $status->canUpdateArtifactInInsecureMode($this->artifact->getTracker());
 }
 private function getCustomReplyToHeader()
 {
     $config = $this->getTrackerPluginConfig();
     $artifactbymail = new Tracker_ArtifactByEmailStatus($config);
     if ($config->isTokenBasedEmailgatewayEnabled()) {
         return array("name" => "Reply-to", "value" => $this->getArtifact()->getTokenBasedEmailAddress());
     } else {
         if ($artifactbymail->canUpdateArtifactInInsecureMode($this->getArtifact()->getTracker())) {
             return array("name" => "Reply-to", "value" => $this->getArtifact()->getInsecureEmailAddress());
         }
     }
 }
 public function itDoesNotUpdateArtifactInInsecureModeWhenTokenModeIsEnabled()
 {
     stub($this->tracker_plugin_conf)->isTokenBasedEmailgatewayEnabled()->returns(true);
     stub($this->tracker_plugin_conf)->isInsecureEmailgatewayEnabled()->returns(false);
     stub($this->tracker)->isEmailgatewayEnabled()->returns(false);
     $tracker_artifactbyemailstatus = new Tracker_ArtifactByEmailStatus($this->tracker_plugin_conf);
     $this->assertFalse($tracker_artifactbyemailstatus->canUpdateArtifactInInsecureMode($this->tracker));
 }