Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / doorkeeper / bridge / __tests__ / DoorkeeperBridgeJIRATestCase.php
blob8a951af73a9626dd6971f589294df2bb9c127f3c
1 <?php
3 final class DoorkeeperBridgeJIRATestCase extends PhabricatorTestCase {
5 public function testJIRABridgeRestAPIURIConversion() {
6 $map = array(
7 array(
8 // Installed at domain root.
9 'http://jira.example.com/rest/api/2/issue/1',
10 'TP-1',
11 'http://jira.example.com/browse/TP-1',
13 array(
14 // Installed on path.
15 'http://jira.example.com/jira/rest/api/2/issue/1',
16 'TP-1',
17 'http://jira.example.com/jira/browse/TP-1',
19 array(
20 // A URI we don't understand.
21 'http://jira.example.com/wake/cli/3/task/1',
22 'TP-1',
23 null,
27 foreach ($map as $inputs) {
28 list($rest_uri, $object_id, $expect) = $inputs;
29 $this->assertEqual(
30 $expect,
31 DoorkeeperBridgeJIRA::getJIRAIssueBrowseURIFromJIRARestURI(
32 $rest_uri,
33 $object_id));