/** * @dataProvider supportProvider */ public function testSupport($url, $assertion) { if ($assertion === true) { $this->assertTrue(SvnDriver::supports($this->getMock('Composer\\IO\\IOInterface'), $url)); } else { $this->assertFalse(SvnDriver::supports($this->getMock('Composer\\IO\\IOInterface'), $url)); } }
/** * {@inheritDoc} */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { if (0 === strpos($url, 'http') && preg_match('/\/svn|svn\//i', $url)) { $url = 'svn' . substr($url, strpos($url, '://')); } return parent::supports($io, $config, $url, $deep); }
/** * @dataProvider supportProvider */ public function testSupport($url, $assertion) { $config = new Config(); $result = SvnDriver::supports($this->getMock('Composer\\IO\\IOInterface'), $config, $url); $this->assertEquals($assertion, $result); }
/** * @dataProvider urlProvider */ public function testCredentials($url, $expect) { $io = new \Composer\IO\NullIO(); $svn = new SvnDriver($url, $io); $this->assertEquals($expect, $svn->getSvnCredentialString()); }
protected function getDriver($url = null) { $url = $url ?: $this->getBaseUrl(); $driver = new SvnDriver(array('type' => 'svn', 'url' => $url), $this->io, $this->config, $this->process); $driver->initialize(); return $driver; }