1
0
Fork 0

* trim the testcase: no need to inject nullio

pull/410/head
till 2012-03-09 17:27:06 +01:00
parent 8d80969f26
commit 25e8ecc5ba
1 changed files with 5 additions and 20 deletions

View File

@ -31,32 +31,18 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase
{ {
$nullIO = new \Composer\IO\NullIO; $nullIO = new \Composer\IO\NullIO;
$input = new \Symfony\Component\Console\Input\ArrayInput(array('install'));
$output = new \Symfony\Component\Console\Output\NullOutput;
$helper = new \Symfony\Component\Console\Helper\HelperSet;
$consoleInteractiveIO = new \Composer\IO\ConsoleIO($input, $output, $helper);
return array( return array(
array( array(
'http://till:test@svn.example.org/', 'http://till:test@svn.example.org/',
" --no-auth-cache --username 'till' --password 'test' ", " --no-auth-cache --username 'till' --password 'test' ",
$nullIO,
), ),
array( array(
'http://svn.apache.org/', 'http://svn.apache.org/',
'', '',
$nullIO,
), ),
array( array(
'svn://johndoe@example.org', 'svn://johndoe@example.org',
" --no-auth-cache --username 'johndoe' --password '' ", " --no-auth-cache --username 'johndoe' --password '' ",
$nullIO,
),
array(
'https://till:secret@corp.svn.local/project1',
" --username 'till' --password 'secret' ",
$consoleInteractiveIO,
), ),
); );
} }
@ -64,15 +50,14 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase
/** /**
* Test the credential string. * Test the credential string.
* *
* @param string $url The SVN url. * @param string $url The SVN url.
* @param string $expect The expectation for the test. * @param string $expect The expectation for the test.
* @param string $ioClass The IO interface.
* *
* @dataProvider urlProvider * @dataProvider urlProvider
*/ */
public function testCredentials($url, $expect, \Composer\IO\IOInterface $io) public function testCredentials($url, $expect)
{ {
$svn = new SvnDriver($url, $io); $svn = new SvnDriver($url, new \Composer\IO\NullIO);
$this->assertEquals($expect, $svn->getSvnCredentialString()); $this->assertEquals($expect, $svn->getSvnCredentialString());
} }