Differential D8657 Diff 20543 src/applications/differential/customfield/DifferentialTestPlanField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/customfield/DifferentialTestPlanField.php
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | final class DifferentialTestPlanField | ||||
public function validateCommitMessageValue($value) { | public function validateCommitMessageValue($value) { | ||||
if (!strlen($value) && $this->isCoreFieldRequired()) { | if (!strlen($value) && $this->isCoreFieldRequired()) { | ||||
throw new DifferentialFieldValidationException( | throw new DifferentialFieldValidationException( | ||||
$this->getCoreFieldRequiredErrorString()); | $this->getCoreFieldRequiredErrorString()); | ||||
} | } | ||||
} | } | ||||
public function shouldAppearInTransactionMail() { | |||||
return true; | |||||
} | |||||
public function updateTransactionMailBody( | |||||
PhabricatorMetaMTAMailBody $body, | |||||
PhabricatorApplicationTransactionEditor $editor, | |||||
array $xactions) { | |||||
if (!$editor->getIsNewObject()) { | |||||
return; | |||||
} | |||||
$test_plan = $this->getValue(); | |||||
if (!strlen(trim($test_plan))) { | |||||
return; | |||||
} | |||||
$body->addTextSection(pht('TEST PLAN'), $test_plan); | |||||
} | |||||
} | } |