/** * @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); }