From 2562755867c9f761910adfe23804997a1a225583 Mon Sep 17 00:00:00 2001 From: till Date: Mon, 12 Mar 2012 21:27:22 +0100 Subject: [PATCH] * add a test to cover SvnDriver::supports() (three fail) --- .../Test/Repository/Vcs/SvnDriverTest.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php index 684681e16..ca9fa8936 100644 --- a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php @@ -95,4 +95,30 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase return $cmd; } + + public static function supportProvider() + { + return array( + array('http://svn.apache.org', true), + array('http://svn.sf.net', true), + array('svn://example.org', true), + array('svn+ssh://example.org', true), + array('file:///d:/repository_name/project', true), + array('file:///repository_name/project', true), + ); + } + + /** + * Nail a bug in {@link SvnDriver::support()}. + * + * @dataProvider supportProvider + */ + public function testSupport($url, $assertion) + { + if ($assertion === true) { + $this->assertTrue(SvnDriver::supports($url)); + } else { + $this->assertFalse(SvnDriver::supports($url)); + } + } }