This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -317,4 +317,34 @@ public function testTranslateWithHTML()
317
317
318
318
$ this ->assertEquals ($ expectedArray , $ translatedText );
319
319
}
320
+
321
+ /**
322
+ * Test translate() with unsupported sourceLanguage
323
+ */
324
+ public function testTranslateWithNotSupportedSourceLanguage ()
325
+ {
326
+ if (self ::$ authKey === false ) {
327
+ $ this ->markTestSkipped ('DeepL Auth Key (DEEPL_AUTH_KEY) is not configured. ' );
328
+ }
329
+
330
+ $ deepl = new DeepL (self ::$ authKey );
331
+
332
+ $ this ->setExpectedException ('\BabyMarkt\DeepL\DeepLException ' );
333
+ $ deepl ->translate ('some txt ' , 'dk ' , 'de ' );
334
+ }
335
+
336
+ /**
337
+ * Test translate() with unsupported sourceLanguage
338
+ */
339
+ public function testTranslateWithNotSupportedDestinationLanguage ()
340
+ {
341
+ if (self ::$ authKey === false ) {
342
+ $ this ->markTestSkipped ('DeepL Auth Key (DEEPL_AUTH_KEY) is not configured. ' );
343
+ }
344
+
345
+ $ deepl = new DeepL (self ::$ authKey );
346
+
347
+ $ this ->setExpectedException ('\BabyMarkt\DeepL\DeepLException ' );
348
+ $ deepl ->translate ('some txt ' , 'en ' , 'dk ' );
349
+ }
320
350
}
You can’t perform that action at this time.
0 commit comments