Skip to content

Commit e68c41d

Browse files
authored
MQE-1047: magentoCLI command does not work if MAGENTO_BASE_URL uses index.php
- apiURL now tries to trim index.php/ if present and all others after first / in url.
1 parent 9bafd56 commit e68c41d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,11 @@ public function scrollToTopOfPage()
457457
*/
458458
public function magentoCLI($command, $arguments = null)
459459
{
460-
$apiURL = $this->config['url'] . getenv('MAGENTO_CLI_COMMAND_PATH');
460+
// trim everything after first '/' in URL after (ex http://magento.instance/<index.php>)
461+
preg_match("/.+\/\/[^\/]+\/?/", $this->config['url'], $trimmed);
462+
$trimmedUrl = $trimmed[0];
463+
$apiURL = $trimmedUrl . ltrim(getenv('MAGENTO_CLI_COMMAND_PATH'), '/');
464+
461465
$executor = new CurlTransport();
462466
$executor->write(
463467
$apiURL,

0 commit comments

Comments
 (0)