Skip to content

Commit 85abcc5

Browse files
elnebulosoxewlJan Thoennessen
authored
[11.5] Add support for filtering projects by topic (#655)
* [14.4] Fix the Create method for Environments (#648) * fix: limit project search by topic Co-authored-by: Ken Verhaegen <[email protected]> Co-authored-by: Jan Thoennessen <[email protected]>
1 parent cfbb5f9 commit 85abcc5

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/Api/Environments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function create($project_id, array $parameters = [])
5757
$resolver->setDefined('external_url')
5858
->setAllowedTypes('external_url', 'string');
5959

60-
return $this->post($this->getProjectPath($project_id, 'environment'), $resolver->resolve($parameters));
60+
return $this->post($this->getProjectPath($project_id, 'environments'), $resolver->resolve($parameters));
6161
}
6262

6363
/**

src/Api/Projects.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class Projects extends AbstractApi
4949
* @var bool $wiki_checksum_failed Limit by failed wiki checksum calculation
5050
* @var bool $with_custom_attributes Include custom attributes in response
5151
* @var string $with_programming_language Limit by programming language
52+
* @var string $topic Limit by topic
5253
* }
5354
*
5455
* @throws UndefinedOptionsException If an option name is undefined
@@ -147,6 +148,7 @@ public function all(array $parameters = [])
147148
->setNormalizer('with_custom_attributes', $booleanNormalizer)
148149
;
149150
$resolver->setDefined('with_programming_language');
151+
$resolver->setDefined('topic');
150152

151153
return $this->get('projects', $resolver->resolve($parameters));
152154
}

tests/Api/EnvironmentsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function shouldCreateEnvironment(): void
166166
$api = $this->getApiMock();
167167
$api->expects($this->once())
168168
->method('post')
169-
->with('projects/1/environment', $params)
169+
->with('projects/1/environments', $params)
170170
->will($this->returnValue($expectedArray));
171171

172172
$this->assertEquals($expectedArray, $api->create(1, $params));

0 commit comments

Comments
 (0)