Skip to content

Commit 8774ac6

Browse files
authored
Merge pull request #526 from magento/MQE-1908-2.5.4
MQE-1908: Change doctor command to work with Curl version of MagentoCLI
2 parents 4c204ac + a243dbd commit 8774ac6

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/Magento/FunctionalTestingFramework/Console/DoctorCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\FunctionalTestingFramework\Console;
99

1010
use Codeception\Configuration;
11+
use Magento\FunctionalTestingFramework\Util\Path\UrlFormatter;
1112
use Symfony\Component\EventDispatcher\EventDispatcher;
1213
use Codeception\SuiteManager;
1314
use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
@@ -128,9 +129,14 @@ private function checkAuthenticationToMagentoAdmin()
128129
$this->ioStyle->success('Successful');
129130
$result = true;
130131
} catch (TestFrameworkException $e) {
132+
if (getenv('MAGENTO_BACKEND_BASE_URL')) {
133+
$urlVar = 'MAGENTO_BACKEND_BASE_URL';
134+
} else {
135+
$urlVar = 'MAGENTO_BASE_URL';
136+
}
131137
$this->ioStyle->error(
132-
$e->getMessage()
133-
. "\nPlease verify MAGENTO_ADMIN_USERNAME and MAGENTO_ADMIN_PASSWORD in .env."
138+
$e->getMessage() . "\nPlease verify if " . $urlVar . ", "
139+
. "MAGENTO_ADMIN_USERNAME and MAGENTO_ADMIN_PASSWORD in .env are valid."
134140
);
135141
}
136142
return $result;

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriverDoctor.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
class MagentoWebDriverDoctor extends MagentoWebDriver
1717
{
18-
const MAGENTO_CLI_COMMAND = 'list';
18+
const MAGENTO_CLI_COMMAND = 'info:currency:list';
1919
const EXCEPTION_CONTEXT_SELENIUM = 'selenium';
2020
const EXCEPTION_CONTEXT_ADMIN = 'admin';
2121
const EXCEPTION_CONTEXT_STOREFRONT = 'store';
@@ -150,18 +150,19 @@ private function loadPageAtUrl($url)
150150
private function runMagentoCLI()
151151
{
152152
try {
153-
$regex = '~^.*(?<name>Magento CLI).*[\r\n]+(?<usage>Usage:).*~';
153+
$regex = '~^.*[\r\n]+.*(?<name>Currency).*(?<code>Code).*~';
154154
$output = parent::magentoCLI(self::MAGENTO_CLI_COMMAND);
155155
preg_match($regex, $output, $matches);
156156

157-
if (isset($matches['name']) && isset($matches['usage'])) {
157+
if (isset($matches['name']) && isset($matches['code'])) {
158158
return;
159159
}
160160
} catch (\Exception $e) {
161-
throw new TestFrameworkException(
162-
"Failed to run Magento CLI command\n"
163-
. "Please reference Magento DevDoc to setup command.php and .htaccess files."
164-
);
165161
}
162+
163+
throw new TestFrameworkException(
164+
"Failed to run Magento CLI command\n"
165+
. "Please reference Magento DevDoc to setup command.php and .htaccess files."
166+
);
166167
}
167168
}

0 commit comments

Comments
 (0)