@@ -92,12 +92,14 @@ public function testTranslateSuccess()
92
92
93
93
$ deepl = new DeepL (self ::$ authKey , 2 , self ::$ apiHost );
94
94
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 ' ;
97
98
98
99
$ translatedText = $ deepl ->translate ($ germanText );
99
100
100
101
self ::assertEquals ($ expectedText , $ translatedText [0 ]['text ' ]);
102
+ self ::assertEquals ($ expectedLanguage , $ translatedText [0 ]['detected_source_language ' ]);
101
103
}
102
104
103
105
/**
@@ -111,12 +113,14 @@ public function testTranslateV1Success()
111
113
112
114
$ deepl = new DeepL (self ::$ authKey , 1 , self ::$ apiHost );
113
115
114
- $ germanText = 'Hallo Welt ' ;
115
- $ expectedText = 'Hello world ' ;
116
+ $ germanText = 'Hallo Welt ' ;
117
+ $ expectedText = 'Hallo Welt ' ;
118
+ $ expectedLanguage = 'IT ' ;
116
119
117
120
$ translatedText = $ deepl ->translate ($ germanText );
118
121
119
122
self ::assertEquals ($ expectedText , $ translatedText [0 ]['text ' ]);
123
+ self ::assertEquals ($ expectedLanguage , $ translatedText [0 ]['detected_source_language ' ]);
120
124
}
121
125
122
126
/**
@@ -383,7 +387,7 @@ public function testTranslateWithHTML()
383
387
$ deepl = new DeepL (self ::$ authKey , 2 , self ::$ apiHost );
384
388
$ textToTranslate = array (
385
389
'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> '
387
391
);
388
392
389
393
$ expectedArray = array (
@@ -393,7 +397,7 @@ public function testTranslateWithHTML()
393
397
),
394
398
array (
395
399
'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> " ,
397
401
),
398
402
399
403
);
0 commit comments