Skip to content

Commit 9ae21f6

Browse files
committed
Better test
1 parent ca894a7 commit 9ae21f6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/RestApiTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,16 @@ public function testDoNotRetryOnWrongCredentials(): void
164164
);
165165

166166
try {
167-
$api->refreshToken();
167+
$api->request('/oauth2/v3/userinfo');
168168
} catch (ClientException $e) {
169169
$this->assertStringContainsString('401 Unauthorized', $e->getMessage());
170170
}
171171

172-
$this->assertEmpty($testHandler->getRecords());
172+
$this->assertCount(1, $testHandler->getRecords());
173+
$this->assertStringContainsString(
174+
'Retrying request (0x) - reason: Unauthorized',
175+
$testHandler->getRecords()[0]['message']
176+
);
173177
}
174178

175179
protected function getEnv(string $name): string

0 commit comments

Comments
 (0)