@@ -92,12 +92,14 @@ public function testTranslateSuccess()
9292
9393 $ deepl = new DeepL (self ::$ authKey , 2 , self ::$ apiHost );
9494
95- $ germanText = 'Hallo Welt ' ;
96- $ expectedText = 'Hello world ' ;
95+ $ germanText = 'Hallo Welt, dies ist ein deutscher Text. ' ;
96+ $ expectedText = 'Hello world, this is a German text. ' ;
97+ $ expectedLanguage = 'DE ' ;
9798
9899 $ translatedText = $ deepl ->translate ($ germanText );
99100
100101 self ::assertEquals ($ expectedText , $ translatedText [0 ]['text ' ]);
102+ self ::assertEquals ($ expectedLanguage , $ translatedText [0 ]['detected_source_language ' ]);
101103 }
102104
103105 /**
@@ -111,12 +113,14 @@ public function testTranslateV1Success()
111113
112114 $ deepl = new DeepL (self ::$ authKey , 1 , self ::$ apiHost );
113115
114- $ germanText = 'Hallo Welt ' ;
115- $ expectedText = 'Hello world ' ;
116+ $ germanText = 'Hallo Welt ' ;
117+ $ expectedText = 'Hallo Welt ' ;
118+ $ expectedLanguage = 'IT ' ;
116119
117120 $ translatedText = $ deepl ->translate ($ germanText );
118121
119122 self ::assertEquals ($ expectedText , $ translatedText [0 ]['text ' ]);
123+ self ::assertEquals ($ expectedLanguage , $ translatedText [0 ]['detected_source_language ' ]);
120124 }
121125
122126 /**
@@ -383,7 +387,7 @@ public function testTranslateWithHTML()
383387 $ deepl = new DeepL (self ::$ authKey , 2 , self ::$ apiHost );
384388 $ textToTranslate = array (
385389 'Hello World<strong>This should stay the same</strong> ' ,
386- 'Another Text<br> new line <p>this is a paragraph</p> '
390+ 'Another Text<br> new line. <p>This is a paragraph</p> '
387391 );
388392
389393 $ expectedArray = array (
@@ -393,7 +397,7 @@ public function testTranslateWithHTML()
393397 ),
394398 array (
395399 'detected_source_language ' => "EN " ,
396- 'text ' => "Eine weitere<br>neue Textzeile <p>, dies ist ein Absatz</p></br> " ,
400+ 'text ' => "Eine weitere<br>neue Textzeile. <p>Dies ist ein Absatz</p></br> " ,
397401 ),
398402
399403 );
0 commit comments