Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96154868
DifferentialTestPlanCommitMessageField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Dec 23, 06:12
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 06:12 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23126849
Attached To
rPH Phabricator
DifferentialTestPlanCommitMessageField.php
View Options
<?php
final
class
DifferentialTestPlanCommitMessageField
extends
DifferentialCommitMessageField
{
const
FIELDKEY
=
'testPlan'
;
public
function
getFieldName
()
{
return
pht
(
'Test Plan'
);
}
public
function
getFieldOrder
()
{
return
3000
;
}
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.'
));
}
}
public
function
readFieldValueFromObject
(
DifferentialRevision
$revision
)
{
return
$revision
->
getTestPlan
();
}
public
function
getFieldTransactions
(
$value
)
{
return
array
(
array
(
'type'
=>
DifferentialRevisionTestPlanTransaction
::
EDITKEY
,
'value'
=>
$value
,
),
);
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
return
$this
->
validateCommitMessageCorpusTransactions
(
$object
,
$xactions
,
pht
(
'Test Plan'
));
}
}
Event Timeline
Log In to Comment