Path: blob/master/src/applications/differential/field/DifferentialTestPlanCommitMessageField.php
12256 views
<?php12final class DifferentialTestPlanCommitMessageField3extends DifferentialCommitMessageField {45const FIELDKEY = 'testPlan';67public function getFieldName() {8return pht('Test Plan');9}1011public function getFieldOrder() {12return 3000;13}1415public function getFieldAliases() {16return array(17'Testplan',18'Tested',19'Tests',20);21}2223public function isFieldEnabled() {24return $this->isCustomFieldEnabled('differential:test-plan');25}2627public function validateFieldValue($value) {28$is_required = PhabricatorEnv::getEnvConfig(29'differential.require-test-plan-field');3031if ($is_required && !strlen($value)) {32$this->raiseValidationException(33pht(34'You must provide a test plan. Describe the actions you performed '.35'to verify the behavior of this change.'));36}37}3839public function readFieldValueFromObject(DifferentialRevision $revision) {40return $revision->getTestPlan();41}4243public function getFieldTransactions($value) {44return array(45array(46'type' => DifferentialRevisionTestPlanTransaction::EDITKEY,47'value' => $value,48),49);50}5152}535455