/**
  * @param string $src
  *
  * @return Configuration
  */
 private function createConfig($src)
 {
     $configuration = new Configuration($src);
     $configuration->setJsonFile('component.json');
     $configuration->setEndpoint('https://bower.herokuapp.com');
     $configuration->setCache(new FilesystemCache($this->target . '/cache'));
     $configuration->setAssetDirectory($this->filesystem->makePathRelative($this->target . '/components', $src));
     return $configuration;
 }
Exemple #2
0
 /**
  * @expectedException \Sp\BowerBundle\Bower\Exception\RuntimeException
  */
 public function testUnsuccessfulInstallThrowsRuntimeException()
 {
     $jsonString = file_get_contents(self::$fixturesDirectory . '/error.json');
     $configDir = "/config_dir";
     $config = new Configuration($configDir);
     $config->setCache($this->cache);
     $this->processBuilder->expects($this->once())->method('getProcess')->will($this->returnValue($this->process));
     $this->process->expects($this->once())->method('isSuccessful')->will($this->returnValue(false));
     $this->process->expects($this->once())->method('getErrorOutput')->will($this->returnValue($jsonString));
     $this->bower->install($config);
 }