/** * @return Tracker_Artifact_MailGateway_IncomingMessage */ private function buildIncomingMessageInInsecureMode(array $raw_mail) { if ($this->isATokenMail($raw_mail['headers']['to'])) { return $this->incoming_message_token_builder->build($raw_mail); } else { return $this->incoming_message_insecure_builder->build($raw_mail); } }
public function itRejectsUnknowArtifact() { stub($this->artifact_factory)->getArtifactById(self::TRACKER_ID)->returns(mock('Tracker_Artifact')); stub($this->user_manager)->getAllUsersByEmail(self::USER_MAIL)->returns(array(mock('PFUser'))); $incoming_message_builder = new Tracker_Artifact_IncomingMessageInsecureBuilder($this->user_manager, $this->tracker_factory, $this->artifact_factory); $raw_mail = array('headers' => array('from' => self::USER_MAIL, 'to' => trackerPlugin::EMAILGATEWAY_INSECURE_ARTIFACT_UPDATE . '*****@*****.**', 'subject' => ''), 'body' => ''); $this->expectException('Tracker_Artifact_MailGateway_ArtifactDoesNotExistException'); $incoming_message_builder->build($raw_mail); }