@@ -86,21 +86,112 @@ public function testApplyWithoutMergeChanges()
86
86
$ this ->assertEmpty ($ this ->mergeTemplate ->apply ('/path/to/working-copy ' ));
87
87
}
88
88
89
- abstract public function testApplyWithMergeChanges ();
89
+ abstract public function testApplyWithMergeChanges ($ regular_or_reverse );
90
90
91
- protected function prepareMergeResult ()
91
+ public function applyWithMergeChangesDataProvider ()
92
92
{
93
- $ this ->connector ->getMergedRevisionChanges ('/path/to/working-copy ' , true )->willReturn (array (
94
- '/projects/project-name/trunk ' => array ('18 ' , '33 ' , '47 ' ),
95
- '/projects/project-name/branches/branch-name ' => array ('4 ' ),
96
- '/projects/another-project-name/tags/stable ' => array ('15 ' ),
97
- '/projects/another-project-name/trunk ' => array ('17 ' ),
98
- ));
93
+ return array (
94
+ 'merge ' => array (true ),
95
+ 'reverse-merge ' => array (false ),
96
+ );
97
+ }
99
98
100
- $ this ->connector ->getMergedRevisionChanges ('/path/to/working-copy ' , false )->willReturn (array (
101
- '/projects/project-name/trunk ' => array ('95 ' , '11 ' ),
102
- '/projects/another-project-name/trunk ' => array ('112 ' ),
103
- ));
99
+ protected function prepareMergeResult ($ regular_or_reverse )
100
+ {
101
+ $ revision_log1 = $ this ->getRevisionLog ('svn://repository.com/projects/project-name/trunk ' );
102
+ $ revision_log2 = $ this ->getRevisionLog ('svn://repository.com/projects/project-name/branches/branch-name ' );
103
+ $ revision_log3 = $ this ->getRevisionLog ('svn://repository.com/projects/another-project-name/tags/stable ' );
104
+ $ revision_log4 = $ this ->getRevisionLog ('svn://repository.com/projects/another-project-name/trunk ' );
105
+
106
+ if ( $ regular_or_reverse ) {
107
+ // Merged revision information.
108
+ $ this ->connector ->getMergedRevisionChanges ('/path/to/working-copy ' , true )->willReturn (array (
109
+ '/projects/project-name/trunk ' => array ('18 ' , '33 ' , '47 ' ),
110
+ '/projects/project-name/branches/branch-name ' => array ('4 ' ),
111
+ '/projects/another-project-name/tags/stable ' => array ('15 ' ),
112
+ '/projects/another-project-name/trunk ' => array ('17 ' ),
113
+ ));
114
+
115
+ $ revision_log1 ->getRevisionsData ('summary ' , array (18 , 33 , 47 ))->willReturn (array (
116
+ 18 => array (
117
+ 'author ' => 'user1 ' ,
118
+ 'date ' => 3534535353 ,
119
+ 'msg ' => 'JRA-100 - own-tr1-line1 ' . PHP_EOL . 'own-tr1-line2 ' . PHP_EOL . PHP_EOL ,
120
+ ),
121
+ 33 => array (
122
+ 'author ' => 'user2 ' ,
123
+ 'date ' => 35345445353 ,
124
+ 'msg ' => 'JRA-120 - own-tr2-line1 ' . PHP_EOL . 'own-tr2-line2 ' . PHP_EOL . PHP_EOL ,
125
+ ),
126
+ 47 => array (
127
+ 'author ' => 'user3 ' ,
128
+ 'date ' => 35345445353 ,
129
+ 'msg ' => 'JRA-100 - own-tr3-line1 ' . PHP_EOL . 'own-tr3-line2 ' . PHP_EOL . PHP_EOL ,
130
+ ),
131
+ ));
132
+
133
+ $ revision_log2 ->getRevisionsData ('summary ' , array (4 ))->willReturn (array (
134
+ 4 => array (
135
+ 'author ' => 'user2 ' ,
136
+ 'date ' => 35345444353 ,
137
+ 'msg ' => 'own-br1-line1 ' . PHP_EOL . 'own-br1-line2 ' . PHP_EOL . PHP_EOL ,
138
+ ),
139
+ ));
140
+
141
+ $ revision_log3 ->getRevisionsData ('summary ' , array (15 ))->willReturn (array (
142
+ 15 => array (
143
+ 'author ' => 'user3 ' ,
144
+ 'date ' => 35345444353 ,
145
+ 'msg ' => 'another-st1-line1 ' . PHP_EOL . 'another-st1-line2 ' . PHP_EOL . PHP_EOL ,
146
+ ),
147
+ ));
148
+
149
+ $ revision_log4 ->getRevisionsData ('summary ' , array (17 ))->willReturn (array (
150
+ 17 => array (
151
+ 'author ' => 'user4 ' ,
152
+ 'date ' => 35345444353 ,
153
+ 'msg ' => 'another-tr1-line1 ' . PHP_EOL . 'another-tr1-line2 ' . PHP_EOL . PHP_EOL ,
154
+ ),
155
+ ));
156
+
157
+ // Reverse-merged revision information.
158
+ $ this ->connector ->getMergedRevisionChanges ('/path/to/working-copy ' , false )->willReturn (array (
159
+ '/projects/project-name/trunk ' => array (),
160
+ ));
161
+ }
162
+ else {
163
+ // Merged revision information.
164
+ $ this ->connector ->getMergedRevisionChanges ('/path/to/working-copy ' , true )->willReturn (array (
165
+ '/projects/project-name/trunk ' => array (),
166
+ ));
167
+
168
+ // Reverse-merged revision information.
169
+ $ this ->connector ->getMergedRevisionChanges ('/path/to/working-copy ' , false )->willReturn (array (
170
+ '/projects/project-name/trunk ' => array ('95 ' , '11 ' ),
171
+ '/projects/another-project-name/trunk ' => array ('112 ' ),
172
+ ));
173
+
174
+ $ revision_log1 ->getRevisionsData ('summary ' , array (95 , 11 ))->willReturn (array (
175
+ 95 => array (
176
+ 'author ' => 'user5 ' ,
177
+ 'date ' => 3534535353 ,
178
+ 'msg ' => 'JRA-100 - own-tr1-line1 ' . PHP_EOL . 'own-tr1-line2(r) ' . PHP_EOL . PHP_EOL ,
179
+ ),
180
+ 11 => array (
181
+ 'author ' => 'user6 ' ,
182
+ 'date ' => 35345445353 ,
183
+ 'msg ' => 'JRA-100 - own-tr2-line1 ' . PHP_EOL . 'own-tr2-line2(r) ' . PHP_EOL . PHP_EOL ,
184
+ ),
185
+ ));
186
+
187
+ $ revision_log4 ->getRevisionsData ('summary ' , array (112 ))->willReturn (array (
188
+ 112 => array (
189
+ 'author ' => 'user7 ' ,
190
+ 'date ' => 35345444353 ,
191
+ 'msg ' => 'another-tr1-line1 ' . PHP_EOL . 'another-tr1-line2(r) ' . PHP_EOL . PHP_EOL ,
192
+ ),
193
+ ));
194
+ }
104
195
105
196
$ this ->connector
106
197
->getWorkingCopyUrl ('/path/to/working-copy ' )
@@ -110,75 +201,6 @@ protected function prepareMergeResult()
110
201
->getRootUrl ('svn://repository.com/path/to/project-name/tags/stable ' )
111
202
->willReturn ('svn://repository.com ' );
112
203
113
- // Merged revision information.
114
- $ revision_log1 = $ this ->getRevisionLog ('svn://repository.com/projects/project-name/trunk ' );
115
- $ revision_log1 ->getRevisionsData ('summary ' , array (18 , 33 , 47 ))->willReturn (array (
116
- 18 => array (
117
- 'author ' => 'user1 ' ,
118
- 'date ' => 3534535353 ,
119
- 'msg ' => 'JRA-100 - own-tr1-line1 ' . PHP_EOL . 'own-tr1-line2 ' . PHP_EOL . PHP_EOL ,
120
- ),
121
- 33 => array (
122
- 'author ' => 'user2 ' ,
123
- 'date ' => 35345445353 ,
124
- 'msg ' => 'JRA-120 - own-tr2-line1 ' . PHP_EOL . 'own-tr2-line2 ' . PHP_EOL . PHP_EOL ,
125
- ),
126
- 47 => array (
127
- 'author ' => 'user3 ' ,
128
- 'date ' => 35345445353 ,
129
- 'msg ' => 'JRA-100 - own-tr3-line1 ' . PHP_EOL . 'own-tr3-line2 ' . PHP_EOL . PHP_EOL ,
130
- ),
131
- ));
132
-
133
- $ revision_log2 = $ this ->getRevisionLog ('svn://repository.com/projects/project-name/branches/branch-name ' );
134
- $ revision_log2 ->getRevisionsData ('summary ' , array (4 ))->willReturn (array (
135
- 4 => array (
136
- 'author ' => 'user2 ' ,
137
- 'date ' => 35345444353 ,
138
- 'msg ' => 'own-br1-line1 ' . PHP_EOL . 'own-br1-line2 ' . PHP_EOL . PHP_EOL ,
139
- ),
140
- ));
141
-
142
- $ revision_log3 = $ this ->getRevisionLog ('svn://repository.com/projects/another-project-name/tags/stable ' );
143
- $ revision_log3 ->getRevisionsData ('summary ' , array (15 ))->willReturn (array (
144
- 15 => array (
145
- 'author ' => 'user3 ' ,
146
- 'date ' => 35345444353 ,
147
- 'msg ' => 'another-st1-line1 ' . PHP_EOL . 'another-st1-line2 ' . PHP_EOL . PHP_EOL ,
148
- ),
149
- ));
150
-
151
- $ revision_log4 = $ this ->getRevisionLog ('svn://repository.com/projects/another-project-name/trunk ' );
152
- $ revision_log4 ->getRevisionsData ('summary ' , array (17 ))->willReturn (array (
153
- 17 => array (
154
- 'author ' => 'user4 ' ,
155
- 'date ' => 35345444353 ,
156
- 'msg ' => 'another-tr1-line1 ' . PHP_EOL . 'another-tr1-line2 ' . PHP_EOL . PHP_EOL ,
157
- ),
158
- ));
159
-
160
- // Reverse-merged revision information.
161
- $ revision_log1 ->getRevisionsData ('summary ' , array (95 , 11 ))->willReturn (array (
162
- 95 => array (
163
- 'author ' => 'user5 ' ,
164
- 'date ' => 3534535353 ,
165
- 'msg ' => 'JRA-100 - own-tr1-line1 ' . PHP_EOL . 'own-tr1-line2(r) ' . PHP_EOL . PHP_EOL ,
166
- ),
167
- 11 => array (
168
- 'author ' => 'user6 ' ,
169
- 'date ' => 35345445353 ,
170
- 'msg ' => 'JRA-100 - own-tr2-line1 ' . PHP_EOL . 'own-tr2-line2(r) ' . PHP_EOL . PHP_EOL ,
171
- ),
172
- ));
173
-
174
- $ revision_log4 ->getRevisionsData ('summary ' , array (112 ))->willReturn (array (
175
- 112 => array (
176
- 'author ' => 'user7 ' ,
177
- 'date ' => 35345444353 ,
178
- 'msg ' => 'another-tr1-line1 ' . PHP_EOL . 'another-tr1-line2(r) ' . PHP_EOL . PHP_EOL ,
179
- ),
180
- ));
181
-
182
204
return array ($ revision_log1 , $ revision_log2 , $ revision_log3 , $ revision_log4 );
183
205
}
184
206
0 commit comments