Differential D17058 Diff 41038 src/applications/differential/field/DifferentialTestPlanCommitMessageField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/field/DifferentialTestPlanCommitMessageField.php
- This file was added.
| <?php | |||||
| final class DifferentialTestPlanCommitMessageField | |||||
| extends DifferentialCommitMessageField { | |||||
| const FIELDKEY = 'testPlan'; | |||||
| public function getFieldName() { | |||||
| return pht('Test Plan'); | |||||
| } | |||||
| public function getFieldAliases() { | |||||
| return array( | |||||
| 'Testplan', | |||||
| 'Tested', | |||||
| 'Tests', | |||||
| ); | |||||
| } | |||||
| public function isFieldEnabled() { | |||||
| return $this->isCustomFieldEnabled('differential:test-plan'); | |||||
| } | |||||
| public function validateFieldValue($value) { | |||||
| $is_required = PhabricatorEnv::getEnvConfig( | |||||
| 'differential.require-test-plan-field'); | |||||
| if ($is_required && !strlen($value)) { | |||||
| $this->raiseValidationException( | |||||
| pht( | |||||
| 'You must provide a test plan. Describe the actions you performed '. | |||||
| 'to verify the behavior of this change.')); | |||||
| } | |||||
| } | |||||
| } | |||||