1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Merge branch '2.2' into 2.3

This commit is contained in:
Jordi Boggiano 2022-08-16 11:27:34 +02:00
commit 550fc3d321
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
3 changed files with 25 additions and 4 deletions

View file

@ -305,14 +305,16 @@ class GitHubDriverTest extends TestCase
}
/**
* @dataProvider invalidUrlProvider
* @param string $url
* @return void
*/
public function initializeInvalidReoUrl(): void
public function testInitializeInvalidRepoUrl($url): void
{
$this->expectException('\InvalidArgumentException');
$repoConfig = array(
'url' => 'https://github.com/acme',
'url' => $url,
);
$io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
@ -324,6 +326,18 @@ class GitHubDriverTest extends TestCase
$gitHubDriver->initialize();
}
/**
* @return list<array{string}>
*/
public function invalidUrlProvider()
{
return array(
array('https://github.com/acme'),
array('https://github.com/acme/repository/releases'),
array('https://github.com/acme/repository/pulls'),
);
}
/**
* @dataProvider supportsProvider
* @param bool $expected
@ -345,6 +359,8 @@ class GitHubDriverTest extends TestCase
array(false, 'https://github.com/acme'),
array(true, 'https://github.com/acme/repository'),
array(true, 'git@github.com:acme/repository.git'),
array(false, 'https://github.com/acme/repository/releases'),
array(false, 'https://github.com/acme/repository/pulls'),
);
}