@@ -122,8 +122,9 @@ public function testDownload(): void
122
122
->will ($ this ->returnValue ('dev-master ' ));
123
123
124
124
$ process = $ this ->getProcessExecutorMock ();
125
+ $ expectedPath = Platform::isWindows () ? 'composerPath ' : Platform::getCwd ().'/composerPath ' ;
125
126
$ process ->expects ([
126
- ['git ' , 'clone ' , '--no-checkout ' , '-- ' , 'https://example.com/composer/composer ' , ' composerPath ' ],
127
+ ['git ' , 'clone ' , '--no-checkout ' , '-- ' , 'https://example.com/composer/composer ' , $ expectedPath ],
127
128
['git ' , 'remote ' , 'add ' , 'composer ' , '-- ' , 'https://example.com/composer/composer ' ],
128
129
['git ' , 'fetch ' , 'composer ' ],
129
130
['git ' , 'remote ' , 'set-url ' , 'origin ' , '-- ' , 'https://example.com/composer/composer ' ],
@@ -209,10 +210,11 @@ public function testDownloadUsesVariousProtocolsAndSetsPushUrlForGithub(): void
209
210
->will ($ this ->returnValue ('1.0.0 ' ));
210
211
211
212
$ process = $ this ->getProcessExecutorMock ();
213
+ $ expectedPath = Platform::isWindows () ? 'composerPath ' : Platform::getCwd ().'/composerPath ' ;
212
214
$ process ->expects ([
213
- ['cmd ' => ['git ' , 'clone ' , '--no-checkout ' , '-- ' , 'https://github.com/mirrors/composer ' , ' composerPath ' ], 'return ' => 1 , 'stderr ' => 'Error1 ' ],
215
+ ['cmd ' => ['git ' , 'clone ' , '--no-checkout ' , '-- ' , 'https://github.com/mirrors/composer ' , $ expectedPath ], 'return ' => 1 , 'stderr ' => 'Error1 ' ],
214
216
215
- ['git ' , 'clone ' , '--no-checkout ' , '-- ' , 'git@github.com:mirrors/composer ' , ' composerPath ' ],
217
+ ['git ' , 'clone ' , '--no-checkout ' , '-- ' , 'git@github.com:mirrors/composer ' , $ expectedPath ],
216
218
['git ' , 'remote ' , 'add ' , 'composer ' , '-- ' , 'git@github.com:mirrors/composer ' ],
217
219
['git ' , 'fetch ' , 'composer ' ],
218
220
['git ' , 'remote ' , 'set-url ' , 'origin ' , '-- ' , 'git@github.com:mirrors/composer ' ],
@@ -265,8 +267,9 @@ public function testDownloadAndSetPushUrlUseCustomVariousProtocolsForGithub(arra
265
267
->will ($ this ->returnValue ('1.0.0 ' ));
266
268
267
269
$ process = $ this ->getProcessExecutorMock ();
270
+ $ expectedPath = Platform::isWindows () ? 'composerPath ' : Platform::getCwd ().'/composerPath ' ;
268
271
$ process ->expects ([
269
- ['git ' , 'clone ' , '--no-checkout ' , '-- ' , $ url , ' composerPath ' ],
272
+ ['git ' , 'clone ' , '--no-checkout ' , '-- ' , $ url , $ expectedPath ],
270
273
['git ' , 'remote ' , 'add ' , 'composer ' , '-- ' , $ url ],
271
274
['git ' , 'fetch ' , 'composer ' ],
272
275
['git ' , 'remote ' , 'set-url ' , 'origin ' , '-- ' , $ url ],
@@ -305,9 +308,10 @@ public function testDownloadThrowsRuntimeExceptionIfGitCommandFails(): void
305
308
->will ($ this ->returnValue ('1.0.0 ' ));
306
309
307
310
$ process = $ this ->getProcessExecutorMock ();
311
+ $ expectedPath = Platform::isWindows () ? 'composerPath ' : Platform::getCwd ().'/composerPath ' ;
308
312
$ process ->expects ([
309
313
[
310
- 'cmd ' => ['git ' , 'clone ' , '--no-checkout ' , '-- ' , 'https://example.com/composer/composer ' , ' composerPath ' ],
314
+ 'cmd ' => ['git ' , 'clone ' , '--no-checkout ' , '-- ' , 'https://example.com/composer/composer ' , $ expectedPath ],
311
315
'return ' => 1 ,
312
316
],
313
317
]);
0 commit comments