Skip to content

Commit e104ec4

Browse files
committed
MQE-1352: bug fix in dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli.php
1 parent 66655f3 commit e104ec4

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ public function execute($command, $options = [])
7272
*/
7373
private function prepareParamArray($command, $options = [])
7474
{
75-
$command .= ' ' . implode(' ', $options);
75+
if (!empty($options)) {
76+
$command .= ' ' . implode(' ', $options);
77+
}
7678
return [
7779
'token' => urlencode($this->webapiHandler->getWebapiToken()),
7880
'command' => urlencode($command)

dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/WebapiDecorator.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,13 @@ protected function setConfiguration(Integration $integration)
171171
*/
172172
protected function isValidIntegration()
173173
{
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);
175181
$response = json_decode($this->read(), true);
176182

177183
return (null !== $response) && !isset($response['message']);
@@ -237,6 +243,10 @@ public function close()
237243
*/
238244
public function getWebapiToken()
239245
{
246+
// Request token if integration is no longer valid
247+
if (!$this->isValidIntegration()) {
248+
$this->init();
249+
}
240250
return $this->webapiToken;
241251
}
242252
}

0 commit comments

Comments
 (0)