Exemplo n.º 1
0
 /**
  * @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));
     }
 }
Exemplo n.º 2
0
    /**
     * {@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);
    }
Exemplo n.º 3
0
 /**
  * @dataProvider supportProvider
  */
 public function testSupport($url, $assertion)
 {
     $config = new Config();
     $result = SvnDriver::supports($this->getMock('Composer\\IO\\IOInterface'), $config, $url);
     $this->assertEquals($assertion, $result);
 }
Exemplo n.º 4
0
 /**
  * @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;
 }