Path: blob/master/src/applications/differential/xaction/DifferentialRevisionTestPlanTransaction.php
12256 views
<?php12final class DifferentialRevisionTestPlanTransaction3extends DifferentialRevisionTransactionType {45const TRANSACTIONTYPE = 'differential.revision.testplan';6const EDITKEY = 'testPlan';78public function generateOldValue($object) {9return $object->getTestPlan();10}1112public function applyInternalEffects($object, $value) {13$object->setTestPlan($value);14}1516public function getTitle() {17return pht(18'%s edited the test plan for this revision.',19$this->renderAuthor());20}2122public function getTitleForFeed() {23return pht(24'%s updated the test plan for %s.',25$this->renderAuthor(),26$this->renderObject());27}2829public function hasChangeDetailView() {30return true;31}3233public function getMailDiffSectionHeader() {34return pht('CHANGES TO TEST PLAN');35}3637public function newChangeDetailView() {38$viewer = $this->getViewer();3940return id(new PhabricatorApplicationTransactionTextDiffDetailView())41->setViewer($viewer)42->setOldText($this->getOldValue())43->setNewText($this->getNewValue());44}4546public function newRemarkupChanges() {47$changes = array();4849$changes[] = $this->newRemarkupChange()50->setOldValue($this->getOldValue())51->setNewValue($this->getNewValue());5253return $changes;54}5556public function validateTransactions($object, array $xactions) {57$errors = $this->validateCommitMessageCorpusTransactions(58$object,59$xactions,60pht('Test Plan'));6162$is_required = PhabricatorEnv::getEnvConfig(63'differential.require-test-plan-field');6465if ($is_required) {66if ($this->isEmptyTextTransaction($object->getTestPlan(), $xactions)) {67$errors[] = $this->newRequiredError(68pht(69'You must provide a test plan. Describe the actions you '.70'performed to verify the behavior of this change.'));71}72}7374return $errors;75}7677public function getTransactionTypeForConduit($xaction) {78return 'testPlan';79}8081public function getFieldValuesForConduit($xaction, $data) {82return array(83'old' => $xaction->getOldValue(),84'new' => $xaction->getNewValue(),85);86}8788}899091