@@ -196,24 +196,7 @@ public function testWillRunSuccessfullyOnNoBcBreaks() : void
196
196
197
197
public function testWillPickTaggedVersionOnNoGivenFrom () : void
198
198
{
199
- (new Process (
200
- [
201
- 'git ' ,
202
- 'checkout ' ,
203
- $ this ->versions [1 ],
204
- ],
205
- $ this ->sourcesRepository
206
- ))->mustRun ();
207
- (new Process (
208
- [
209
- 'git ' ,
210
- 'tag ' ,
211
- '1.2.3 ' ,
212
- '-m ' ,
213
- 'First tag ' ,
214
- ],
215
- $ this ->sourcesRepository
216
- ))->mustRun ();
199
+ $ this ->tagOnVersion ('1.2.3 ' , 1 );
217
200
218
201
$ check = new Process (
219
202
[
@@ -241,42 +224,8 @@ public function testWillPickTaggedVersionOnNoGivenFrom() : void
241
224
242
225
public function testWillPickLatestTaggedVersionOnNoGivenFrom () : void
243
226
{
244
- (new Process (
245
- [
246
- 'git ' ,
247
- 'checkout ' ,
248
- $ this ->versions [1 ],
249
- ],
250
- $ this ->sourcesRepository
251
- ))->mustRun ();
252
- (new Process (
253
- [
254
- 'git ' ,
255
- 'tag ' ,
256
- '2.2.3 ' ,
257
- '-m ' ,
258
- 'First tag ' ,
259
- ],
260
- $ this ->sourcesRepository
261
- ))->mustRun ();
262
- (new Process (
263
- [
264
- 'git ' ,
265
- 'checkout ' ,
266
- $ this ->versions [3 ],
267
- ],
268
- $ this ->sourcesRepository
269
- ))->mustRun ();
270
- (new Process (
271
- [
272
- 'git ' ,
273
- 'tag ' ,
274
- '1.2.3 ' ,
275
- '-m ' ,
276
- 'First tag ' ,
277
- ],
278
- $ this ->sourcesRepository
279
- ))->mustRun ();
227
+ $ this ->tagOnVersion ('2.2.3 ' , 1 );
228
+ $ this ->tagOnVersion ('1.2.3 ' , 3 );
280
229
281
230
$ check = new Process (
282
231
[
@@ -301,4 +250,27 @@ public function testWillPickLatestTaggedVersionOnNoGivenFrom() : void
301
250
$ errorOutput // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT
302
251
);
303
252
}
253
+
254
+ private function tagOnVersion (string $ tagName , int $ version ) : void
255
+ {
256
+ (new Process (
257
+ [
258
+ 'git ' ,
259
+ 'checkout ' ,
260
+ $ this ->versions [$ version ],
261
+ ],
262
+ $ this ->sourcesRepository
263
+ ))->mustRun ();
264
+
265
+ (new Process (
266
+ [
267
+ 'git ' ,
268
+ 'tag ' ,
269
+ $ tagName ,
270
+ '-m ' ,
271
+ 'A tag for version ' . $ version ,
272
+ ],
273
+ $ this ->sourcesRepository
274
+ ))->mustRun ();
275
+ }
304
276
}
0 commit comments