Skip to content

Commit

Permalink
Make SvnDriverTest and XzDownloaderTest more portable on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Dec 31, 2021
1 parent b196669 commit 965a427
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions tests/Composer/Test/Downloader/XzDownloaderTest.php
Expand Up @@ -41,6 +41,9 @@ public function setUp(): void

protected function tearDown(): void
{
if (Platform::isWindows()) {
return;
}
parent::tearDown();
$this->fs = new Filesystem;
$this->fs->removeDirectory($this->testDir);
Expand Down
19 changes: 13 additions & 6 deletions tests/Composer/Test/Repository/Vcs/SvnDriverTest.php
Expand Up @@ -17,6 +17,7 @@
use Composer\Test\TestCase;
use Composer\Util\Filesystem;
use Composer\Test\Mock\ProcessExecutorMock;
use Composer\Util\ProcessExecutor;

class SvnDriverTest extends TestCase
{
Expand Down Expand Up @@ -60,13 +61,19 @@ public function testWrongCredentialsInUrl()
$output .= " rejected Basic challenge (https://corp.svn.local/)";

$process = $this->getProcessExecutorMock();
$authedCommand = sprintf(
'svn ls --verbose --non-interactive --username %s --password %s -- %s',
ProcessExecutor::escape('till'),
ProcessExecutor::escape('secret'),
ProcessExecutor::escape('https://till:secret@corp.svn.local/repo/trunk')
);
$process->expects(array(
array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output),
array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output),
array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output),
array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output),
array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output),
array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output),
array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output),
array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output),
array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output),
array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output),
array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output),
array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output),
array('cmd' => 'svn --version', 'return' => 0, 'stdout' => '1.2.3'),
), true);

Expand Down

0 comments on commit 965a427

Please sign in to comment.