Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2ac56f3

Browse files
authored
Merge pull request #23 from Baby-Markt/master-fix
Fix the integration tests
2 parents 1146901 + e43eb13 commit 2ac56f3

File tree

1 file changed

+4
-29
lines changed

1 file changed

+4
-29
lines changed

tests/integration/DeepLApiTest.php

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testTranslateSuccess()
6868
$deepl = new DeepL(self::$authKey);
6969

7070
$germanText = 'Hallo Welt';
71-
$expectedText = 'Hello World';
71+
$expectedText = 'Hello world';
7272

7373
$translatedText = $deepl->translate($germanText);
7474

@@ -87,7 +87,7 @@ public function testTranslateV1Success()
8787
$deepl = new DeepL(self::$authKey, 1);
8888

8989
$germanText = 'Hallo Welt';
90-
$expectedText = 'Hello World';
90+
$expectedText = 'Hello world';
9191

9292
$translatedText = $deepl->translate($germanText);
9393

@@ -288,7 +288,7 @@ public function testTranslateFormality()
288288
$deepl = new DeepL(self::$authKey);
289289

290290
$englishText = '<strong>text to do not translate</strong><p>please translate this text</p>';
291-
$expectedText = '<stark>nicht zu übersetzender Text</stark><p>bitte diesen Text übersetzen</p>';
291+
$expectedText = '<strong>Nicht zu übersetzender Text</strong><p>Bitte übersetze diesen Text</p>';
292292
$translatedText = $deepl->translate(
293293
$englishText,
294294
'en', //$sourceLanguage
@@ -301,31 +301,6 @@ public function testTranslateFormality()
301301
$this->assertEquals($expectedText, $translatedText[0]['text']);
302302
}
303303

304-
/**
305-
* Test translate() $formality
306-
*/
307-
public function testTranslateFormalityFail()
308-
{
309-
if (self::$authKey === false) {
310-
$this->markTestSkipped('DeepL Auth Key (DEEPL_AUTH_KEY) is not configured.');
311-
}
312-
313-
$deepl = new DeepL(self::$authKey);
314-
$englishText = '<strong>text to do not translate</strong><p>please translate this text</p>';
315-
316-
$this->setExpectedException('\BabyMarkt\DeepL\DeepLException');
317-
318-
$deepl->translate(
319-
$englishText,
320-
'en', //$sourceLanguage
321-
'es', //$destinationLanguage
322-
null, //$tagHandling
323-
null, //$ignoreTags
324-
'more' //$formality
325-
);
326-
}
327-
328-
329304
/**
330305
* Test to Test the Tag-Handling.
331306
*/
@@ -348,7 +323,7 @@ public function testTranslateWithHTML()
348323
),
349324
array(
350325
'detected_source_language' => "EN",
351-
'text' => "Ein weiterer Text neue Zeile <p>dies ist ein Absatz</p>",
326+
'text' => "Ein weiterer Text<br>neue Zeile <p>dies ist ein Absatz</p></br> ",
352327
),
353328

354329
);

0 commit comments

Comments
 (0)