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 +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -104,9 +104,15 @@ public function testCheckLanguagesDestinationLanguageException()
104
104
*/
105
105
public function testBuildUrl ()
106
106
{
107
- $ expectedString = 'https://api.deepl.com/v1/translate?auth_key=123456&source_lang=de&target_lang=en&formality=default ' ;
108
-
109
107
$ 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
+
110
116
$ deepl = new DeepL ($ authKey );
111
117
112
118
$ buildUrl = self ::getMethod ('\BabyMarkt\DeepL\DeepL ' , 'buildUrl ' );
@@ -121,10 +127,16 @@ public function testBuildUrl()
121
127
*/
122
128
public function testBuildUrlWithTags ()
123
129
{
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
-
127
130
$ 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
+
128
140
$ deepl = new DeepL ($ authKey );
129
141
130
142
$ buildUrl = self ::getMethod ('\BabyMarkt\DeepL\DeepL ' , 'buildUrl ' );
You can’t perform that action at this time.
0 commit comments