4 * This file is part of the Fxp Composer Asset Plugin package.
6 * (c) François Pluchino <francois.pluchino@gmail.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Fxp\Composer\AssetPlugin\Tests\Repository;
15 use Composer\EventDispatcher\EventDispatcher;
16 use Composer\IO\IOInterface;
17 use Fxp\Composer\AssetPlugin\Repository\BowerPrivateRepository;
20 * Tests of Private Bower repository.
22 * @author Marcus Stüben <marcus@it-stueben.de>
24 class BowerPrivateRepositoryTest extends AbstractAssetsRepositoryTest
29 protected function getType()
37 protected function getRegistry(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null)
39 return new BowerPrivateRepository($repoConfig, $io, $config, $eventDispatcher);
45 protected function getMockPackageForVcsConfig()
48 'url' => 'http://foo.tld',
55 protected function getMockSearchResult($name = 'mock-package')
67 protected function getCustomRepoConfig()
70 'private-registry-url' => 'http://foo.tld',
75 * @expectedException \Fxp\Composer\AssetPlugin\Exception\InvalidCreateRepositoryException
76 * @expectedExceptionMessage The "repository.url" parameter of "existing" bower asset package must be present for create a VCS Repository
78 public function testWhatProvidesWithInvalidPrivateUrl()
80 $name = $this->getType().'-asset/existing';
81 $rfs = $this->replaceRegistryRfsByMock();
82 $rfs->expects($this->any())
83 ->method('getContents')
84 ->will($this->returnValue(json_encode(array())));
86 $this->registry->whatProvides($this->pool, $name);