Skip to content

Commit f80b572

Browse files
authored
[11.11] Add support for tier in Environments::create (#758)
1 parent 9f630a1 commit f80b572

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Api/Environments.php

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function all($project_id, array $parameters = [])
4444
*
4545
* @var string $name The name of the environment
4646
* @var string $external_url Place to link to for this environment
47+
* @var string $tier The tier of the new environment. Allowed values are production, staging, testing, development, and other.
4748
* }
4849
*
4950
* @return mixed
@@ -56,6 +57,8 @@ public function create($project_id, array $parameters = [])
5657
->setAllowedTypes('name', 'string');
5758
$resolver->setDefined('external_url')
5859
->setAllowedTypes('external_url', 'string');
60+
$resolver->setDefined('tier')
61+
->setAllowedValues('tier', ['production', 'staging', 'testing', 'development', 'other']);
5962

6063
return $this->post($this->getProjectPath($project_id, 'environments'), $resolver->resolve($parameters));
6164
}

tests/Api/EnvironmentsTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,14 @@ public function shouldCreateEnvironment(): void
155155
'name' => 'review/fix-baz',
156156
'slug' => 'review-fix-baz-dfjre5',
157157
'external_url' => 'https://review-fix-baz-dfjre5.example.gitlab.com',
158+
'tier' => 'production',
158159
],
159160
];
160161

161162
$params = [
162163
'name' => 'review/fix-baz',
163164
'external_url' => 'https://review-fix-baz-dfjre5.example.gitlab.com',
165+
'tier' => 'production',
164166
];
165167

166168
$api = $this->getApiMock();

0 commit comments

Comments
 (0)