Skip to content

Commit 41afe3d

Browse files
committed
MQE-1902: Running bin/magento from MagentoWebDriver causing timeout issues on pipeline
fixed phpunit checks
1 parent 3becb62 commit 41afe3d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,6 @@ public function makeScreenshot($name = null)
849849
*
850850
* @throws \RuntimeException
851851
* @return string
852-
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
853852
*/
854853
private function shellExecMagentoCLI($magentoBinary, $command, $timeout, $arguments): string
855854
{
@@ -870,10 +869,8 @@ private function shellExecMagentoCLI($magentoBinary, $command, $timeout, $argume
870869
if (empty($output)) {
871870
$output = "CLI did not return output.";
872871
}
873-
874872
} catch (ProcessTimedOutException $exception) {
875873
$output = "CLI command timed out, no output available.";
876-
877874
}
878875

879876
if ($this->checkForFilePath($output)) {
@@ -933,21 +930,25 @@ private function curlExecMagentoCLI($command, $timeout, $arguments): string
933930

934931
/**
935932
* Checks magento list of CLI commands for given $command. Does not check command parameters, just base command.
933+
*
936934
* @param string $magentoBinary
937935
* @param string $command
938-
* @return bool
936+
*
937+
* @return boolean
939938
*/
940939
private function validateCommand($magentoBinary, $command)
941940
{
942941
exec($magentoBinary . ' list', $commandList);
943942
// Trim list of commands after first whitespace
944-
$commandList = array_map(array($this, 'trimAfterWhitespace'), $commandList);
943+
$commandList = array_map([$this, 'trimAfterWhitespace'], $commandList);
945944
return in_array($this->trimAfterWhitespace($command), $commandList);
946945
}
947946

948947
/**
949948
* Returns given string trimmed of everything after the first found whitespace.
949+
*
950950
* @param string $string
951+
*
951952
* @return string
952953
*/
953954
private function trimAfterWhitespace($string)
@@ -957,13 +958,13 @@ private function trimAfterWhitespace($string)
957958

958959
/**
959960
* Detects file path in string.
961+
*
960962
* @param string $string
963+
*
961964
* @return boolean
962965
*/
963966
private function checkForFilePath($string)
964967
{
965968
return preg_match('/\/[\S]+\//', $string);
966969
}
967-
968-
}
969-
970+
}

0 commit comments

Comments
 (0)