private function processCopy(Tracker_Artifact_Changeset $from_changeset, PFUser $current_user, array $submitted_values) { $xml_artifacts = $this->getXMLRootNode(); $this->xml_exporter->exportSnapshotWithoutComments($xml_artifacts, $from_changeset); $this->file_updater->update($xml_artifacts->artifact); $this->xml_updater->update($this->tracker, $xml_artifacts->artifact, $submitted_values, $current_user, $_SERVER['REQUEST_TIME']); $this->children_xml_exporter->exportChildren($xml_artifacts); $extraction_path = ''; $artifact = $this->xml_importer->importOneArtifactFromXML($this->tracker, $xml_artifacts->artifact[0], $extraction_path); if ($artifact) { $this->artifacts_imported_mapping->add($from_changeset->getArtifact()->getId(), $artifact->getId()); $this->children_xml_importer->importChildren($this->artifacts_imported_mapping, $xml_artifacts, $extraction_path, $artifact, $current_user); $this->addSummaryCommentChangeset($artifact, $current_user, $from_changeset); $this->redirectToArtifact($artifact); } else { $this->logsErrorAndRedirectToTracker('plugin_tracker', 'error_create_copy', $from_changeset->getArtifact()->getId()); } }
public function itDoesNotUpdateFieldIfTheyAreNotSubmitted() { expect($this->visitor)->update()->count(2); $this->updater->update($this->tracker, $this->artifact_xml, $this->submitted_values, $this->user, time()); }