diff --git a/tests/integration/GlossaryTest.php b/tests/integration/GlossaryTest.php index dc98871..8954328 100644 --- a/tests/integration/GlossaryTest.php +++ b/tests/integration/GlossaryTest.php @@ -136,4 +136,21 @@ public function testDeleteGlossary($glossaryId) self::assertNull($response); } + + public function testClientBugOnManyRequests_itThrowsWhenMakingARequestAfterADeleteRequest() + { + if (self::$authKey === false) { + self::markTestSkipped('DeepL Auth Key (DEEPL_AUTH_KEY) is not configured.'); + } + + $deepl = new Glossary(self::$authKey); + $entries = ['Hallo' => 'Hello']; + $glossary = $deepl->createGlossary('test', $entries, 'de', 'en'); + + $response = $deepl->deleteGlossary($glossary['glossary_id']); + self::assertNull($response); + + // This line throws error "The Response seems to not be valid JSON." + $glossary = $deepl->createGlossary('test', $entries, 'de', 'en'); + } }