Explorar el Código

* add a test to cover SvnDriver::supports() (three fail)

till hace 13 años
padre
commit
2562755867
Se han modificado 1 ficheros con 26 adiciones y 0 borrados
  1. 26 0
      tests/Composer/Test/Repository/Vcs/SvnDriverTest.php

+ 26 - 0
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));
+        }
+    }
 }