Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/differential/field/__tests__/DifferentialCommitMessageFieldTestCase.php
12262 views
1
<?php
2
3
final class DifferentialCommitMessageFieldTestCase
4
extends PhabricatorTestCase {
5
6
public function testRevisionCommitMessageFieldParsing() {
7
$base_uri = 'https://www.example.com/';
8
9
$tests = array(
10
'D123' => 123,
11
'd123' => 123,
12
" \n d123 \n " => 123,
13
"D123\nSome-Custom-Field: The End" => 123,
14
"{$base_uri}D123" => 123,
15
"{$base_uri}D123\nSome-Custom-Field: The End" => 123,
16
'https://www.other.com/D123' => null,
17
);
18
19
$env = PhabricatorEnv::beginScopedEnv();
20
$env->overrideEnvConfig('phabricator.base-uri', $base_uri);
21
22
foreach ($tests as $input => $expect) {
23
$actual = id(new DifferentialRevisionIDCommitMessageField())
24
->parseFieldValue($input);
25
$this->assertEqual($expect, $actual, pht('Parse of: %s', $input));
26
}
27
28
unset($env);
29
}
30
31
}
32
33