Ejemplo n.º 1
0
 /**
  * @expectedException RuntimeException
  */
 public function testWrongCredentialsInUrl()
 {
     $console = $this->getMock('Composer\\IO\\IOInterface');
     $console->expects($this->once())->method('isInteractive')->will($this->returnValue(true));
     $output = "svn: OPTIONS of 'http://corp.svn.local/repo':";
     $output .= " authorization failed: Could not authenticate to server:";
     $output .= " rejected Basic challenge (http://corp.svn.local/)";
     $process = $this->getMock('Composer\\Util\\ProcessExecutor');
     $process->expects($this->once())->method('execute')->will($this->returnValue(1));
     $process->expects($this->once())->method('getErrorOutput')->will($this->returnValue($output));
     $svn = new SvnDriver('http://*****:*****@corp.svn.local/repo', $console, new Config(), $process);
     $svn->initialize();
 }
Ejemplo n.º 2
0
 /**
  * @expectedException RuntimeException
  */
 public function testWrongCredentialsInUrl()
 {
     $console = $this->getMock('Composer\\IO\\IOInterface');
     $output = "svn: OPTIONS of 'http://corp.svn.local/repo':";
     $output .= " authorization failed: Could not authenticate to server:";
     $output .= " rejected Basic challenge (http://corp.svn.local/)";
     $process = $this->getMock('Composer\\Util\\ProcessExecutor');
     $process->expects($this->at(1))->method('execute')->will($this->returnValue(1));
     $process->expects($this->exactly(7))->method('getErrorOutput')->will($this->returnValue($output));
     $process->expects($this->at(2))->method('execute')->will($this->returnValue(0));
     $config = new Config();
     $config->merge(array('config' => array('home' => sys_get_temp_dir() . '/composer-test')));
     $repoConfig = array('url' => 'http://*****:*****@corp.svn.local/repo');
     $svn = new SvnDriver($repoConfig, $console, $config, $process);
     $svn->initialize();
 }
 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;
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function initialize()
 {
     $this->url = 0 === strpos($this->url, 'svn+http') ? substr($this->url, 4) : $this->url;
     parent::initialize();
 }