@@ -118,7 +118,35 @@ public function testRetries(): void
118118
119119 foreach ($ this ->testHandler ->getRecords () as $ key => $ value ) {
120120 $ this ->assertEquals (Logger::INFO , $ value ['level ' ]);
121- $ this ->assertEquals (sprintf ('Retrying request (%dx) ' , $ key ), $ value ['message ' ]);
121+ $ this ->assertEquals (sprintf ('Retrying request (%dx) - reason: Not Found ' , $ key ), $ value ['message ' ]);
122+ $ this ->assertEquals (
123+ [
124+ 'request ' => [
125+ 'uri ' => 'https://www.googleapis.com/auth/invalid-scope ' ,
126+ 'headers ' => [
127+ 'User-Agent ' => ['GuzzleHttp/6.5.5 curl/7.74.0 PHP/7.4.30 ' ],
128+ 'Host ' => ['www.googleapis.com ' ],
129+ 'Accept ' => ['application/json ' ],
130+ 'Authorization ' => '***** ' ,
131+
132+ ],
133+ 'method ' => 'GET ' ,
134+ 'body ' => '' ,
135+ ],
136+ 'response ' => [
137+ 'statusCode ' => 404 ,
138+ 'reason ' => 'Not Found ' ,
139+ 'body ' => 'You are receiving this error either because your input OAuth2 scope name is ' .
140+ "invalid or it refers to a newer scope that is outside the domain of this legacy API. \n\n" .
141+ 'This API was built at a time when the scope name format was not yet standardized. This ' .
142+ 'is no longer the case and all valid scope names (both old and new) are catalogued at ' .
143+ 'https://developers.google.com/identity/protocols/oauth2/scopes. Use that webpage to ' .
144+ ' lookup (manually) the scope name associated with the API you are trying to call and use ' .
145+ " it to craft your OAuth2 request. \n" ,
146+ ],
147+ ],
148+ $ value ['context ' ]
149+ );
122150 }
123151 }
124152
0 commit comments