Skip to content

Commit b289b14

Browse files
Merge branch '11.7' into 11.8
2 parents 61274c4 + 8c8d944 commit b289b14

File tree

7 files changed

+26
-18
lines changed

7 files changed

+26
-18
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Implement group merge requests endpoints
1616
* Implement event endpoints
1717

18-
[11.8.0]: https://github.com/GitLabPHP/Client/compare/11.7.0...11.8.0
18+
[11.8.0]: https://github.com/GitLabPHP/Client/compare/11.7.1...11.8.0
19+
20+
## [11.7.1] - 2022-04-24
21+
22+
* Fixed `GroupsEpic::all()` method
23+
* Fixed `Projects::createPipeline()` method
24+
25+
[11.7.1]: https://github.com/GitLabPHP/Client/compare/11.7.0...11.7.1
1926

2027
## [11.7.0] - 2022-01-24
2128

src/Api/AbstractApi.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ protected function get(string $uri, array $params = [], array $headers = [])
103103
* @param array<string,mixed> $params
104104
* @param array<string,string> $headers
105105
* @param array<string,string> $files
106+
* @param array<string,mixed> $uriParams
106107
*
107108
* @return mixed
108109
*/
109-
protected function post(string $uri, array $params = [], array $headers = [], array $files = [])
110+
protected function post(string $uri, array $params = [], array $headers = [], array $files = [], array $uriParams = [])
110111
{
111112
if (0 < \count($files)) {
112113
$builder = $this->createMultipartStreamBuilder($params, $files);
@@ -120,7 +121,7 @@ protected function post(string $uri, array $params = [], array $headers = [], ar
120121
}
121122
}
122123

123-
$response = $this->client->getHttpClient()->post(self::prepareUri($uri), $headers, $body);
124+
$response = $this->client->getHttpClient()->post(self::prepareUri($uri, $uriParams), $headers, $body);
124125

125126
return ResponseMediator::getContent($response);
126127
}

src/Api/GroupsEpics.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ class GroupsEpics extends AbstractApi
1919
/**
2020
* @var string
2121
*/
22-
public const STATE_ACTIVE = 'active';
22+
public const STATE_ALL = 'all';
23+
24+
/**
25+
* @var string
26+
*/
27+
public const STATE_OPENED = 'opened';
2328

2429
/**
2530
* @var string
@@ -47,7 +52,7 @@ public function all($group_id, array $parameters = [])
4752
})
4853
;
4954
$resolver->setDefined('state')
50-
->setAllowedValues('state', [self::STATE_ACTIVE, self::STATE_CLOSED])
55+
->setAllowedValues('state', [self::STATE_ALL, self::STATE_OPENED, self::STATE_CLOSED])
5156
;
5257
$resolver->setDefined('search');
5358

src/Api/Projects.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,15 @@ public function pipelineVariables($project_id, int $pipeline_id)
432432
*/
433433
public function createPipeline($project_id, string $commit_ref, array $variables = null)
434434
{
435-
$parameters = [
436-
'ref' => $commit_ref,
437-
];
435+
$parameters = [];
438436

439437
if (null !== $variables) {
440438
$parameters['variables'] = $variables;
441439
}
442440

443-
return $this->post($this->getProjectPath($project_id, 'pipeline'), $parameters);
441+
return $this->post($this->getProjectPath($project_id, 'pipeline'), $parameters, [], [], [
442+
'ref' => $commit_ref,
443+
]);
444444
}
445445

446446
/**

tests/Api/ProjectsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ public function shouldCreatePipeline(): void
859859
$api = $this->getApiMock();
860860
$api->expects($this->once())
861861
->method('post')
862-
->with('projects/1/pipeline', ['ref' => 'test-pipeline'])
862+
->with('projects/1/pipeline', [], [], [], ['ref' => 'test-pipeline'])
863863
->will($this->returnValue($expectedArray));
864864

865865
$this->assertEquals($expectedArray, $api->createPipeline(1, 'test-pipeline'));
@@ -888,7 +888,7 @@ public function shouldCreatePipelineWithVariables(): void
888888
$api = $this->getApiMock();
889889
$api->expects($this->once())
890890
->method('post')
891-
->with('projects/1/pipeline', ['ref' => 'test-pipeline', 'variables' => $variables])
891+
->with('projects/1/pipeline', ['variables' => $variables], [], [], ['ref' => 'test-pipeline'])
892892
->will($this->returnValue($expectedArray));
893893

894894
$this->assertEquals($expectedArray, $api->createPipeline(1, 'test-pipeline', $variables));

tests/HttpClient/Message/ResponseMediatorTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,7 @@ public function testGetErrrorMessageInvalidJson(): void
7575

7676
public function testGetPagination(): void
7777
{
78-
$header = <<<'TEXT'
79-
<https://example.gitlab.com>; rel="first",
80-
<https://example.gitlab.com>; rel="next",
81-
<https://example.gitlab.com>; rel="prev",
82-
<https://example.gitlab.com>; rel="last",
83-
TEXT;
78+
$header = '<https://example.gitlab.com>; rel="first",<https://example.gitlab.com>; rel="next",<https://example.gitlab.com>; rel="prev",<https://example.gitlab.com>; rel="last"';
8479

8580
$pagination = [
8681
'first' => 'https://example.gitlab.com',

tests/IntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testRepoContributors(): void
2626

2727
$response = $client
2828
->repositories()
29-
->contributors(5315609);
29+
->contributors(16155465);
3030

3131
$this->assertIsArray($response);
3232
$this->assertTrue(isset($response[2]));

0 commit comments

Comments
 (0)