public function itExportsAnonUser() { expect($this->user_xml_exporter)->exportUserByMail()->once(); $changeset = mock('Tracker_Artifact_Changeset'); stub($changeset)->getSubmittedBy()->returns(null); stub($changeset)->getEmail()->returns('*****@*****.**'); $this->exporter->exportFullHistory($this->artifact_xml, $changeset); }
/** * Add to $artifacts_xml the xml structure of an artifact */ public function exportFullHistory(SimpleXMLElement $artifacts_xml, Tracker_Artifact $artifact) { $artifact_xml = $artifacts_xml->addChild('artifact'); $artifact_xml->addAttribute('id', $artifact->getId()); foreach ($artifact->getChangesets() as $changeset) { $this->changeset_exporter->exportFullHistory($artifact_xml, $changeset); } }
public function itExportsTheComments() { $user = aUser()->withId(101)->withLdapId('ldap_01')->withUserName('user_01')->build(); stub($this->user_manager)->getUserById(101)->returns($user); expect($this->values_exporter)->exportChangedFields($this->artifact_xml, '*', $this->artifact, $this->values)->once(); expect($this->comment)->exportToXML()->once(); $this->exporter->exportFullHistory($this->artifact_xml, $this->changeset); }
public function itRemovesNullValuesInChangesetValues() { $value = mock('Tracker_Artifact_ChangesetValue'); expect($this->values_exporter)->exportChangedFields('*', '*', '*', array(101 => $value))->once(); $changeset = stub('Tracker_Artifact_Changeset')->getValues()->returns(array(101 => $value, 102 => null)); $this->exporter->exportFullHistory($this->artifact_xml, $changeset); }