Skip to content

Commit 2b35311

Browse files
committed
added testcase
1 parent 2afb40c commit 2b35311

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/Github/Tests/HttpClient/Plugin/GithubExceptionThrowerTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,22 @@ public static function responseProvider()
196196
),
197197
'exception' => new \Github\Exception\RuntimeException('This endpoint requires you to be authenticated.', 401),
198198
],
199+
'Cannot delete active deployment' => [
200+
'response' => new Response(
201+
422,
202+
[
203+
'content-type' => 'application/json',
204+
],
205+
json_encode(
206+
[
207+
'message' => 'Validation Failed',
208+
'errors' => ['We cannot delete an active deployment unless it is the only deployment in a given environment.'],
209+
'documentation_url' => 'https://docs.github.com/rest/reference/repos#delete-a-deployment'
210+
]
211+
)
212+
),
213+
'exception' => new \Github\Exception\ValidationFailedException('Validation Failed', 422),
214+
],
199215
];
200216
}
201217
}

0 commit comments

Comments
 (0)