コード例 #1
0
ファイル: SvnDriverTest.php プロジェクト: songhongyu/idaiyan
 /**
  * @dataProvider getSupportsUrls
  */
 public function testSupports($url, $supperted)
 {
     /* @var IOInterface $io */
     $io = $this->getMock('Composer\\IO\\IOInterface');
     $this->assertSame($supperted, SvnDriver::supports($io, $this->config, $url, false));
 }
コード例 #2
0
 /**
  * @dataProvider getSupportsUrls
  *
  * @param string $url
  * @param string $supperted
  * @param string $urlUsed
  */
 public function testSupports($url, $supperted, $urlUsed)
 {
     /* @var IOInterface $io */
     $io = $this->getMockBuilder('Composer\\IO\\IOInterface')->getMock();
     $this->assertSame($supperted, SvnDriver::supports($io, $this->config, $url, false));
     if (!$supperted) {
         return;
     }
     $process = $this->getMockBuilder('Composer\\Util\\ProcessExecutor')->getMock();
     $process->expects($this->any())->method('execute')->will($this->returnCallback(function () {
         return 0;
     }));
     $repoConfig = array('url' => $url, 'asset-type' => 'bower', 'filename' => 'bower.json');
     /* @var IOInterface $io */
     /* @var ProcessExecutor $process */
     $driver = new SvnDriver($repoConfig, $io, $this->config, $process, null);
     $driver->initialize();
     $this->assertEquals($urlUsed, $driver->getUrl());
 }