File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
dev/tests/functional/lib/Magento/Mtf/Util Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,9 @@ public function execute($command, $options = [])
72
72
*/
73
73
private function prepareParamArray ($ command , $ options = [])
74
74
{
75
- $ command .= ' ' . implode (' ' , $ options );
75
+ if (!empty ($ options )) {
76
+ $ command .= ' ' . implode (' ' , $ options );
77
+ }
76
78
return [
77
79
'token ' => urlencode ($ this ->webapiHandler ->getWebapiToken ()),
78
80
'command ' => urlencode ($ command )
Original file line number Diff line number Diff line change @@ -171,7 +171,13 @@ protected function setConfiguration(Integration $integration)
171
171
*/
172
172
protected function isValidIntegration ()
173
173
{
174
- $ this ->write ($ _ENV ['app_frontend_url ' ] . 'rest/V1/modules ' , [], CurlInterface::GET );
174
+ $ url = rtrim ($ _ENV ['app_frontend_url ' ], '/ ' );
175
+ if (strpos ($ url , 'index.php ' ) === false ) {
176
+ $ url .= '/index.php/rest/V1/modules ' ;
177
+ } else {
178
+ $ url .= '/rest/V1/modules ' ;
179
+ }
180
+ $ this ->write ($ url , [], CurlInterface::GET );
175
181
$ response = json_decode ($ this ->read (), true );
176
182
177
183
return (null !== $ response ) && !isset ($ response ['message ' ]);
@@ -237,6 +243,10 @@ public function close()
237
243
*/
238
244
public function getWebapiToken ()
239
245
{
246
+ // Request token if integration is no longer valid
247
+ if (!$ this ->isValidIntegration ()) {
248
+ $ this ->init ();
249
+ }
240
250
return $ this ->webapiToken ;
241
251
}
242
252
}
You can’t perform that action at this time.
0 commit comments