1
0
Fork 0

Make SvnDriverTest and XzDownloaderTest more portable on Windows

pull/10343/head
Jordi Boggiano 2021-12-31 17:08:31 +01:00
parent ccd87c479c
commit a4a2b6da87
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 16 additions and 6 deletions

View File

@ -41,6 +41,9 @@ class XzDownloaderTest extends TestCase
protected function tearDown(): void
{
if (Platform::isWindows()) {
return;
}
parent::tearDown();
$this->fs = new Filesystem;
$this->fs->removeDirectory($this->testDir);

View File

@ -17,6 +17,7 @@ use Composer\Config;
use Composer\Test\TestCase;
use Composer\Util\Filesystem;
use Composer\Test\Mock\ProcessExecutorMock;
use Composer\Util\ProcessExecutor;
class SvnDriverTest extends TestCase
{
@ -60,13 +61,19 @@ class SvnDriverTest extends TestCase
$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);