8000 Fix windows test expectations · composer/composer@69ceac3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 69ceac3

Browse files
committed
Fix windows test expectations
1 parent b5b9fdb commit 69ceac3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/Composer/Test/Downloader/GitDownloaderTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ public function testDownload(): void
122122
->will($this->returnValue('dev-master'));
123123

124124
$process = $this->getProcessExecutorMock();
125+
$expectedPath = Platform::isWindows() ? 'composerPath' : Platform::getCwd().'/composerPath';
125126
$process->expects([
126-
['git', 'clone', '--no-checkout', '--', 'https://example.com/composer/composer', 'composerPath'],
127+
['git', 'clone', '--no-checkout', '--', 'https://example.com/composer/composer', $expectedPath],
127128
['git', 'remote', 'add', 'composer', '--', 'https://example.com/composer/composer'],
128129
['git', 'fetch', 'composer'],
129130
['git', 'remote', 'set-url', 'origin', '--', 'https://example.com/composer/composer'],
@@ -209,10 +210,11 @@ public function testDownloadUsesVariousProtocolsAndSetsPushUrlForGithub(): void
209210
->will($this->returnValue('1.0.0'));
210211

211212
$process = $this->getProcessExecutorMock();
213+
$expectedPath = Platform::isWindows() ? 'composerPath' : Platform::getCwd().'/composerPath';
212214
$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'],
214216

215-
['git', 'clone', '--no-checkout', '--', 'git@github.com:mirrors/composer', 'composerPath'],
217+
['git', 'clone', '--no-checkout', '--', 'git@github.com:mirrors/composer', $expectedPath],
216218
['git', 'remote', 'add', 'composer', '--', 'git@github.com:mirrors/composer'],
217219
['git', 'fetch', 'composer'],
218220
['git', 'remote', 'set-url', 'origin', '--', 'git@github.com:mirrors/composer'],
@@ -265,8 +267,9 @@ public function testDownloadAndSetPushUrlUseCustomVariousProtocolsForGithub(arra
265267
->will($this->returnValue('1.0.0'));
266268

267269
$process = $this->getProcessExecutorMock();
270+
$expectedPath = Platform::isWindows() ? 'composerPath' : Platform::getCwd().'/composerPath';
268271
$process->expects([
269-
['git', 'clone', '--no-checkout', '--', $url, 'composerPath'],
272+
['git', 'clone', '--no-checkout', '--', $url, $expectedPath],
270273
['git', 'remote', 'add', 'composer', '--', $url],
271274
['git', 'fetch', 'composer'],
272275
['git', 'remote', 'set-url', 'origin', '--', $url],
@@ -305,9 +308,10 @@ public function testDownloadThrowsRuntimeExceptionIfGitCommandFails(): void
305308
->will($this->returnValue('1.0.0'));
306309

307310
$process = $this->getProcessExecutorMock();
311+
$expectedPath = Platform::isWindows() ? 'composerPath' : Platform::getCwd().'/composerPath';
308312
$process->expects([
309313
[
310-
'cmd' => ['git', 'clone', '--no-checkout', '--', 'https://example.com/composer/composer', 'composerPath'],
314+
'cmd' => ['git', 'clone', '--no-checkout', '--', 'https://example.com/composer/composer', $expectedPath],
311315
'return' => 1,
312316
],
313317
]);

0 commit comments

Comments
 (0)
0