~ubuntu-branches/ubuntu/wily/phabricator/wily-proposed

« back to all changes in this revision

Viewing changes to arcanist/src/parser/__tests__/ArcanistBaseCommitParserTestCase.php

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2015-05-25 22:45:19 UTC
  • mfrom: (0.29.1) (0.28.1) (0.27.1) (9.1.1 wily)
  • Revision ID: package-import@ubuntu.com-20150525224519-x791swte8e0ndv8c
Tags: 0~git20150525-1
* New snapshot release
* fix update postinst when using nginx (closes: #784221)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
 
3
 
final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
 
3
final class ArcanistBaseCommitParserTestCase extends PhutilTestCase {
4
4
 
5
5
  public function testBasics() {
6
6
    // Verify that the very basics of base commit resolution work.
7
7
    $this->assertCommit(
8
 
      'Empty Rules',
 
8
      pht('Empty Rules'),
9
9
      null,
10
10
      array(
11
11
      ));
23
23
    // test cases intentionally scramble argument order to test that resolution
24
24
    // order is independent of argument order.
25
25
    $this->assertCommit(
26
 
      'Order: Args',
 
26
      pht('Order: Args'),
27
27
      'y',
28
28
      array(
29
29
        'local'   => 'literal:n',
33
33
      ));
34
34
 
35
35
    $this->assertCommit(
36
 
      'Order: Local',
 
36
      pht('Order: Local'),
37
37
      'y',
38
38
      array(
39
39
        'project' => 'literal:n',
42
42
      ));
43
43
 
44
44
    $this->assertCommit(
45
 
      'Order: Project',
 
45
      pht('Order: Project'),
46
46
      'y',
47
47
      array(
48
48
        'project' => 'literal:y',
50
50
      ));
51
51
 
52
52
    $this->assertCommit(
53
 
      'Order: Global',
 
53
      pht('Order: Global'),
54
54
      'y',
55
55
      array(
56
56
        'user' => 'literal:y',
60
60
  public function testLegacyRule() {
61
61
    // 'global' should translate to 'user'
62
62
    $this->assertCommit(
63
 
      '"global" name',
 
63
      pht('"%s" name', 'global'),
64
64
      'y',
65
65
      array(
66
66
        'runtime' => 'arc:global, arc:halt',
71
71
 
72
72
    // 'args' should translate to 'runtime'
73
73
    $this->assertCommit(
74
 
      '"args" name',
 
74
      pht('"%s" name', 'args'),
75
75
      'y',
76
76
      array(
77
77
        'runtime' => 'arc:project, literal:y',
84
84
  public function testHalt() {
85
85
    // 'arc:halt' should halt all processing.
86
86
    $this->assertCommit(
87
 
      'Halt',
 
87
      pht('Halt'),
88
88
      null,
89
89
      array(
90
90
        'runtime' => 'arc:halt',
95
95
  public function testYield() {
96
96
    // 'arc:yield' should yield to other rulesets.
97
97
    $this->assertCommit(
98
 
      'Yield',
 
98
      pht('Yield'),
99
99
      'xyz',
100
100
      array(
101
101
        'runtime' => 'arc:yield, literal:abc',
104
104
 
105
105
    // This one should return to 'runtime' after exhausting 'local'.
106
106
    $this->assertCommit(
107
 
      'Yield + Return',
 
107
      pht('Yield + Return'),
108
108
      'abc',
109
109
      array(
110
110
        'runtime' => 'arc:yield, literal:abc',
115
115
  public function testJump() {
116
116
    // This should resolve to 'abc' without hitting any of the halts.
117
117
    $this->assertCommit(
118
 
      'Jump',
 
118
      pht('Jump'),
119
119
      'abc',
120
120
      array(
121
121
        'runtime' => 'arc:project, arc:halt',
128
128
  public function testJumpReturn() {
129
129
    // After jumping to project, we should return to 'runtime'.
130
130
    $this->assertCommit(
131
 
      'Jump Return',
 
131
      pht('Jump Return'),
132
132
      'xyz',
133
133
      array(
134
134
        'runtime' => 'arc:project, literal:xyz',