/**
  * @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;
 }
    /**
     * @covers Sp\BowerBundle\Bower\Configuration::getJson
     */
    public function testGetJsonReturnsObject()
    {
        $config = new Configuration('/foo');
        $config->setDirectory('/test');
        $config->setAssetDirectory('/foo');
        $config->setJsonFile('foo.json');
        $expected = <<<json
{"directory":"..\\/foo\\/","json":"foo.json"}
json;
        $this->assertEquals($expected, $config->getJson());
    }
 public function testUpdate()
 {
     $configuration = new Configuration('/foo');
     $configuration->setAssetDirectory('/test');
     $configuration->setJsonFile('foo.json');
     $barConfig = new Configuration('/bar');
     $bundles = array('DemoBundle' => $configuration, 'AcmeBundle' => $barConfig);
     $this->bower->expects($this->at(0))->method('update')->with($this->equalTo($configuration));
     $this->bower->expects($this->at(1))->method('update')->with($this->equalTo($barConfig));
     $this->bm->expects($this->once())->method('getBundles')->will($this->returnValue($bundles));
     $this->command->run(new ArrayInput(array()), new NullOutput());
 }