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

Commit 468105f

Browse files
committed
update test expected url, to make them more readable
1 parent 7eb729c commit 468105f

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

tests/DeepLTest.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,15 @@ public function testCheckLanguagesDestinationLanguageException()
104104
*/
105105
public function testBuildUrl()
106106
{
107-
$expectedString = 'https://api.deepl.com/v1/translate?auth_key=123456&source_lang=de&target_lang=en&formality=default';
108-
109107
$authKey = '123456';
108+
109+
$expectedString = 'https://api.deepl.com/v1/translate?' . http_build_query(array(
110+
'auth_key' => $authKey,
111+
'source_lang' => 'de',
112+
'target_lang' => 'en',
113+
'formality' => 'default'
114+
));
115+
110116
$deepl = new DeepL($authKey);
111117

112118
$buildUrl = self::getMethod('\BabyMarkt\DeepL\DeepL', 'buildUrl');
@@ -121,10 +127,16 @@ public function testBuildUrl()
121127
*/
122128
public function testBuildUrlWithTags()
123129
{
124-
$expectedString = 'https://api.deepl.com';
125-
$expectedString .= '/v1/translate?auth_key=123456&source_lang=de&target_lang=en&tag_handling=xml&ignore_tags=x&formality=default';
126-
127130
$authKey = '123456';
131+
$expectedString = 'https://api.deepl.com/v1/translate?' . http_build_query(array(
132+
'auth_key' => $authKey,
133+
'source_lang' => 'de',
134+
'target_lang' => 'en',
135+
'tag_handling' => 'xml',
136+
'ignore_tags' => 'x',
137+
'formality' => 'default'
138+
));
139+
128140
$deepl = new DeepL($authKey);
129141

130142
$buildUrl = self::getMethod('\BabyMarkt\DeepL\DeepL', 'buildUrl');

0 commit comments

Comments
 (0)