File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,9 @@ public function getParRequestUri(array $body):UriInterface{
4141 $ status = $ response ->getStatusCode ();
4242 $ json = MessageUtil::decodeJSON ($ response , true );
4343
44+ // the response should be a 201, see: https://github.com/chillerlan/php-oauth/issues/6
4445 // something went horribly wrong
45- if ($ status !== 200 ){
46+ if ($ status !== 201 ){
4647
4748 // @link https://datatracker.ietf.org/doc/html/rfc9126#section-2.3
4849 if (isset ($ json ['error ' ], $ json ['error_description ' ])){
Original file line number Diff line number Diff line change @@ -93,7 +93,12 @@ public function testGetParAuthURL():void{
9393 // @link https://datatracker.ietf.org/doc/html/rfc9126#name-successful-response
9494 $ json = '{"request_uri":"urn:ietf:params:oauth:request_uri:6esc_11ACC5bwc014ltc14eY22c","expires_in":60} ' ;
9595
96- $ this ->setMockResponse ($ this ->streamFactory ->createStream ($ json ));
96+ $ response = $ this ->responseFactory
97+ ->createResponse (201 )
98+ ->withBody ($ this ->streamFactory ->createStream ($ json ))
99+ ;
100+
101+ $ this ->setMockResponse ($ response );
97102
98103 $ uri = $ this ->provider ->getAuthorizationURL ();
99104 $ params = QueryUtil::parse ($ uri ->getQuery ());
You can’t perform that action at this time.
0 commit comments