Analyze Magento Admin.
Definition at line 19 of file AdminAnalyzer.php.
◆ __construct()
__construct |
( |
ObjectManagerInterface |
$objectManager, |
|
|
UrlAnalyzer |
$urlAnalyzer |
|
) |
| |
- Parameters
-
ObjectManagerInterface | $objectManager | |
UrlAnalyzer | $urlAnalyzer | |
Definition at line 46 of file AdminAnalyzer.php.
50 parent::__construct();
52 $this->urlAnalyzer = $urlAnalyzer;
◆ configure()
Configure command.
- Returns
- void
Definition at line 60 of file AdminAnalyzer.php.
63 $this->setName(
'troubleshooting:check-magento-admin')
64 ->setDescription(
'Check that app_backend_url is correct and admin can log in to Admin.');
◆ execute()
execute |
( |
InputInterface |
$input, |
|
|
OutputInterface |
$output |
|
) |
| |
|
protected |
Execute command.
- Parameters
-
InputInterface | $input | |
OutputInterface | $output | |
- Returns
- void @SuppressWarnings(PHPMD.UnusedFormalParameter)
Definition at line 75 of file AdminAnalyzer.php.
77 \PHPUnit\Util\Configuration::getInstance(MTF_PHPUNIT_FILE)->handlePHPConfiguration();
78 $this->
output = $this->objectManager->create(
82 $this->
output->writeln(
"Verifying Magento Admin...");
84 if (isset($adminUrlAnalyzerMessages[
'error']) ===
false) {
85 $this->
output->outputMessages($this->urlAnalyzer->checkDomain($_ENV[
'app_backend_url']));
87 $this->
output->outputMessages($adminUrlAnalyzerMessages);
89 $this->
output->writeln(
"Admin verification finished.");
output($string, $level=INFO, $label='')
◆ runAdminUrlAnalyzer()
Execute Admin url analyzer check.
- Returns
- null|array
Definition at line 97 of file AdminAnalyzer.php.
99 if (!isset($_ENV[
'app_backend_url'])) {
100 $messages[
'error'][] =
'app_backend_url parameter is absent in the phpunit.xml file. ' 101 .
'Please, copy parameter from phpunit.xml.dist.';
104 $this->
output->outputMessages($this->urlAnalyzer->fixLastSlash(
'app_backend_url'));
105 $url1 = $_ENV[
'app_backend_url'];
106 if (strpos($url1,
'/index.php') !==
false) {
107 $url2 = str_replace(
'/index.php',
'', $url1);
113 $urls = [$url1, $url2];
116 $_ENV[
'app_backend_url'] =
$url;
118 $config = \Magento\Mtf\ObjectManagerFactory::getObjectManager()->create(
121 $curl =
new BackendDecorator(
new CurlTransport(),
$config);
123 if (strpos(
$response,
'404') !==
false) {
129 }
catch (\Exception $e) {
133 if ($isUrlValid ==
false) {
134 $messages[
'error'][] =
'Check correctness of app_backend_url in phpunit.xml.';
136 }
elseif ($url1 != $_ENV[
'app_backend_url']) {
137 return $this->urlAnalyzer->resolveIndexPhpProblem($_ENV[
'app_backend_url']);
output($string, $level=INFO, $label='')
elseif(isset( $params[ 'redirect_parent']))
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/functional/lib/Magento/Mtf/Troubleshooting/AdminAnalyzer.php