1
0
Fork 0

Implement ordering in requesting tags and branches.

Update unit test with latest changes.
pull/6094/head
Stefan Grootscholten 2017-01-22 15:55:17 +01:00
parent 046b1184dc
commit 5dbdefdd72
3 changed files with 9 additions and 7 deletions

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "e18501d127e13e3619f80abbcf372c81", "content-hash": "cc935b611f9e58595c17efc6e7eff79a",
"packages": [ "packages": [
{ {
"name": "composer/ca-bundle", "name": "composer/ca-bundle",

View File

@ -264,7 +264,8 @@ abstract class BitbucketDriver extends VcsDriver
http_build_query( http_build_query(
array( array(
'pagelen' => 100, 'pagelen' => 100,
'fields' => 'values.name,values.target.hash,next' 'fields' => 'values.name,values.target.hash,next',
'sort' => '-target.date'
) )
) )
); );
@ -305,7 +306,8 @@ abstract class BitbucketDriver extends VcsDriver
http_build_query( http_build_query(
array( array(
'pagelen' => 100, 'pagelen' => 100,
'fields' => 'values.name,values.target.hash,next' 'fields' => 'values.name,values.target.hash,next',
'sort' => '-target.date'
) )
) )
); );

View File

@ -118,12 +118,12 @@ class GitBitbucketDriverTest extends TestCase
), ),
array( array(
$this->originUrl, $this->originUrl,
'https://api.bitbucket.org/2.0/repositories/user/repo/refs/tags?pagelen=100&fields=values.name%2Cvalues.target.hash%2Cnext', 'https://api.bitbucket.org/2.0/repositories/user/repo/refs/tags?pagelen=100&fields=values.name%2Cvalues.target.hash%2Cnext&sort=-target.date',
false false
), ),
array( array(
$this->originUrl, $this->originUrl,
'https://api.bitbucket.org/2.0/repositories/user/repo/refs/branches?pagelen=100&fields=values.name%2Cvalues.target.hash%2Cnext', 'https://api.bitbucket.org/2.0/repositories/user/repo/refs/branches?pagelen=100&fields=values.name%2Cvalues.target.hash%2Cnext&sort=-target.date',
false false
), ),
array( array(
@ -133,7 +133,7 @@ class GitBitbucketDriverTest extends TestCase
), ),
array( array(
$this->originUrl, $this->originUrl,
'https://api.bitbucket.org/1.0/repositories/user/repo/changesets/master', 'https://api.bitbucket.org/2.0/repositories/user/repo/commit/master?fields=date',
false false
) )
) )
@ -143,7 +143,7 @@ class GitBitbucketDriverTest extends TestCase
'{"values":[{"name":"1.0.1","target":{"hash":"9b78a3932143497c519e49b8241083838c8ff8a1"}},{"name":"1.0.0","target":{"hash":"d3393d514318a9267d2f8ebbf463a9aaa389f8eb"}}]}', '{"values":[{"name":"1.0.1","target":{"hash":"9b78a3932143497c519e49b8241083838c8ff8a1"}},{"name":"1.0.0","target":{"hash":"d3393d514318a9267d2f8ebbf463a9aaa389f8eb"}}]}',
'{"values":[{"name":"master","target":{"hash":"937992d19d72b5116c3e8c4a04f960e5fa270b22"}}]}', '{"values":[{"name":"master","target":{"hash":"937992d19d72b5116c3e8c4a04f960e5fa270b22"}}]}',
'{"name": "user/repo","description": "test repo","license": "GPL","authors": [{"name": "Name","email": "local@domain.tld"}],"require": {"creator/package": "^1.0"},"require-dev": {"phpunit/phpunit": "~4.8"}}', '{"name": "user/repo","description": "test repo","license": "GPL","authors": [{"name": "Name","email": "local@domain.tld"}],"require": {"creator/package": "^1.0"},"require-dev": {"phpunit/phpunit": "~4.8"}}',
'{"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}' '{"date": "2016-05-17T13:19:52+00:00"}'
); );
$this->assertEquals( $this->assertEquals(