Skip to content

Commit e566606

Browse files
committed
Add a test for sso required exception
1 parent 51b49cb commit e566606

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Github\Tests\HttpClient\Plugin;
44

55
use Github\Exception\ExceptionInterface;
6+
use Github\Exception\SsoRequiredException;
67
use Github\HttpClient\Plugin\GithubExceptionThrower;
78
use GuzzleHttp\Promise\FulfilledPromise;
89
use GuzzleHttp\Psr7\Response;
@@ -136,6 +137,16 @@ public static function responseProvider()
136137
),
137138
'exception' => new \Github\Exception\RuntimeException('Something went wrong with executing your query', 502),
138139
],
140+
'Sso required Response' => [
141+
'response' => new Response(
142+
403,
143+
[
144+
'Content-Type' => 'application/json',
145+
'X-GitHub-SSO' => 'required; url=https://github.com/orgs/octodocs-test/sso?authorization_request=AZSCKtL4U8yX1H3sCQIVnVgmjmon5fWxks5YrqhJgah0b2tlbl9pZM4EuMz4',
146+
]
147+
),
148+
'exception' => new \Github\Exception\SsoRequiredException('https://github.com/orgs/octodocs-test/sso?authorization_request=AZSCKtL4U8yX1H3sCQIVnVgmjmon5fWxks5YrqhJgah0b2tlbl9pZM4EuMz4')
149+
],
139150
'Default handling' => [
140151
'response' => new Response(
141152
555,

0 commit comments

Comments
 (0)