mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Add types to Repository
tests (#10227)
This commit is contained in:
parent
3d9e9ba66f
commit
d51c7685da
15 changed files with 133 additions and 23 deletions
|
@ -72,7 +72,7 @@ class GitLabDriverTest extends TestCase
|
|||
$fs->removeDirectory($this->home);
|
||||
}
|
||||
|
||||
public function getInitializeUrls()
|
||||
public function provideInitializeUrls()
|
||||
{
|
||||
return array(
|
||||
array('https://gitlab.com/mygroup/myproject', 'https://gitlab.com/api/v4/projects/mygroup%2Fmyproject'),
|
||||
|
@ -82,7 +82,10 @@ class GitLabDriverTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getInitializeUrls
|
||||
* @dataProvider provideInitializeUrls
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $apiUrl
|
||||
*/
|
||||
public function testInitialize($url, $apiUrl)
|
||||
{
|
||||
|
@ -119,7 +122,10 @@ JSON;
|
|||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getInitializeUrls
|
||||
* @dataProvider provideInitializeUrls
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $apiUrl
|
||||
*/
|
||||
public function testInitializePublicProject($url, $apiUrl)
|
||||
{
|
||||
|
@ -156,7 +162,10 @@ JSON;
|
|||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getInitializeUrls
|
||||
* @dataProvider provideInitializeUrls
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $apiUrl
|
||||
*/
|
||||
public function testInitializePublicProjectAsAnonymous($url, $apiUrl)
|
||||
{
|
||||
|
@ -417,6 +426,9 @@ JSON;
|
|||
/**
|
||||
* @group gitlabHttpPort
|
||||
* @dataProvider dataForTestSupports
|
||||
*
|
||||
* @param string $url
|
||||
* @param bool $expected
|
||||
*/
|
||||
public function testSupports($url, $expected)
|
||||
{
|
||||
|
@ -608,6 +620,13 @@ JSON;
|
|||
$this->assertEquals('https://gitlab.com/mygroup/myproject.git', $driver->getRepositoryUrl(), 'Repository URL matches config request for http not git');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param mixed[] $options
|
||||
* @param string|null $return
|
||||
*
|
||||
* @return \Prophecy\Prophecy\MethodProphecy
|
||||
*/
|
||||
private function mockResponse($url, $options, $return)
|
||||
{
|
||||
return $this->httpDownloader
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue