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

Add support section to composer data for bitbucket repositories.

This commit is contained in:
Stefan Grootscholten 2016-06-17 17:35:43 +02:00
parent ccfd9018b8
commit 78fcb5a366
2 changed files with 39 additions and 2 deletions

View file

@ -16,6 +16,9 @@ use Composer\Config;
use Composer\TestCase;
use Composer\Util\Filesystem;
/**
* @group bitbucket
*/
class GitBitbucketDriverTest extends TestCase
{
/** @type \Composer\IO\IOInterface|\PHPUnit_Framework_MockObject_MockObject */
@ -124,11 +127,15 @@ class GitBitbucketDriverTest extends TestCase
->method('getContents')
->withConsecutive(
array('bitbucket.org', 'https://api.bitbucket.org/1.0/repositories/user/repo/src/master/composer.json', false),
array('bitbucket.org', 'https://api.bitbucket.org/1.0/repositories/user/repo/changesets/master', false)
array('bitbucket.org', 'https://api.bitbucket.org/1.0/repositories/user/repo/changesets/master', false),
array('bitbucket.org', 'https://api.bitbucket.org/1.0/repositories/user/repo/tags', false),
array('bitbucket.org', 'https://api.bitbucket.org/1.0/repositories/user/repo/branches', false)
)
->willReturnOnConsecutiveCalls(
'{"node": "937992d19d72", "path": "composer.json", "data": "{\n \"name\": \"user/repo\",\n \"description\": \"test repo\",\n \"license\": \"GPL\",\n \"authors\": [\n {\n \"name\": \"Name\",\n \"email\": \"local@domain.tld\"\n }\n ],\n \"require\": {\n \"creator/package\": \"^1.0\"\n },\n \"require-dev\": {\n \"phpunit/phpunit\": \"~4.8\"\n }\n}\n", "size": 269}',
'{"node": "937992d19d72", "files": [{"type": "modified", "file": "path/to/file"}], "raw_author": "User <local@domain.tld>", "utctimestamp": "2016-05-17 11:19:52+00:00", "author": "user", "timestamp": "2016-05-17 13:19:52", "raw_node": "937992d19d72b5116c3e8c4a04f960e5fa270b22", "parents": ["71e195a33361"], "branch": "master", "message": "Commit message\n", "revision": null, "size": -1}'
'{"node": "937992d19d72", "files": [{"type": "modified", "file": "path/to/file"}], "raw_author": "User <local@domain.tld>", "utctimestamp": "2016-05-17 11:19:52+00:00", "author": "user", "timestamp": "2016-05-17 13:19:52", "raw_node": "937992d19d72b5116c3e8c4a04f960e5fa270b22", "parents": ["71e195a33361"], "branch": "master", "message": "Commit message\n", "revision": null, "size": -1}',
'{}',
'{"master": {"node": "937992d19d72", "files": [{"type": "modified", "file": "path/to/file"}], "raw_author": "User <local@domain.tld>", "utctimestamp": "2016-05-17 11:19:52+00:00", "author": "user", "timestamp": "2016-05-17 13:19:52", "raw_node": "937992d19d72b5116c3e8c4a04f960e5fa270b22", "parents": ["71e195a33361"], "branch": "master", "message": "Commit message\n", "revision": null, "size": -1}}'
);
$this->assertEquals(
@ -149,6 +156,9 @@ class GitBitbucketDriverTest extends TestCase
'phpunit/phpunit' => '~4.8'
),
'time' => '2016-05-17 13:19:52',
'support' => array(
'source' => 'https://bitbucket.org/user/repo/src/937992d19d72b5116c3e8c4a04f960e5fa270b22/?at=master'
)
),
$driver->getComposerInformation('master')
);