Skip to content

Commit a83eade

Browse files
committed
MQE-1536: Magento\Install\Test\TestCase\InstallTest is failing
- reverting MAGETWO-99210
1 parent 7b523ee commit a83eade

File tree

9 files changed

+43
-1
lines changed

9 files changed

+43
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ protected function authorize()
109109
$isAuthorized = true;
110110
$_ENV['app_backend_url'] = $url;
111111
break;
112+
// phpcs:ignore Magento2.Exceptions.ThrowCatch
112113
} catch (\Exception $e) {
113114
continue;
114115
}

dev/tests/functional/utils/authenticate.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
*
1010
* @param string $token
1111
* @return bool
12+
*
13+
* phpcs:disable Squiz.Functions.GlobalFunction
1214
*/
1315
function authenticate($token)
1416
{
17+
// phpcs:ignore Magento2.Security.IncludeFile
1518
require_once __DIR__ . '/../../../../app/bootstrap.php';
1619

20+
// phpcs:ignore Magento2.Security.Superglobal
1721
$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER);
22+
// phpcs:ignore Magento2.Security.Superglobal
1823
$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER);
1924
$tokenModel = $magentoObjectManager->get(\Magento\Integration\Model\Oauth\Token::class);
2025

dev/tests/functional/utils/command.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,25 @@
1313

1414
// phpcs:ignore Magento2.Security.Superglobal
1515
if (!empty($_POST['token']) && !empty($_POST['command'])) {
16+
// phpcs:ignore Magento2.Security.Superglobal
1617
if (authenticate(urldecode($_POST['token']))) {
18+
// phpcs:ignore Magento2.Security.Superglobal
1719
$command = urldecode($_POST['command']);
1820
// phpcs:ignore Magento2.Security.Superglobal
1921
$magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER);
2022
// phpcs:ignore Magento2.Security.Superglobal
2123
$magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER);
2224
$cli = $magentoObjectManager->create(\Magento\Framework\Console\Cli::class);
25+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
2326
$input = new StringInput(escapeshellcmd($command));
2427
$input->setInteractive(false);
2528
$output = new NullOutput();
2629
$cli->doRun($input, $output);
2730
} else {
31+
// phpcs:ignore Magento2.Security.LanguageConstruct
2832
echo "Command not unauthorized.";
2933
}
3034
} else {
35+
// phpcs:ignore Magento2.Security.LanguageConstruct
3136
echo "'token' or 'command' parameter is not set.";
3237
}

dev/tests/functional/utils/deleteMagentoGeneratedCode.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
// phpcs:ignore Magento2.Security.IncludeFile
77
include __DIR__ . '/authenticate.php';
88

9+
// phpcs:ignore Magento2.Security.Superglobal
910
if (!empty($_POST['token']) && !empty($_POST['path'])) {
11+
// phpcs:ignore Magento2.Security.Superglobal
1012
if (authenticate(urldecode($_POST['token']))) {
1113
// phpcs:ignore Magento2.Security.InsecureFunction
1214
exec('rm -rf ../../../../generated/*');
1315
} else {
16+
// phpcs:ignore Magento2.Security.LanguageConstruct
1417
echo "Command not unauthorized.";
1518
}
1619
} else {
20+
// phpcs:ignore Magento2.Security.LanguageConstruct
1721
echo "'token' parameter is not set.";
1822
}

dev/tests/functional/utils/export.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
// phpcs:ignore Magento2.Security.IncludeFile
77
include __DIR__ . '/authenticate.php';
88

9+
// phpcs:ignore Magento2.Security.Superglobal
910
if (!empty($_POST['token']) && !empty($_POST['template'])) {
11+
// phpcs:ignore Magento2.Security.Superglobal
1012
if (authenticate(urldecode($_POST['token']))) {
11-
$varDir = '../../../../var/';
13+
$varDir = '../../../../var/export/';
14+
// phpcs:ignore Magento2.Security.Superglobal
1215
$template = urldecode($_POST['template']);
1316
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1417
$fileList = scandir($varDir, SCANDIR_SORT_NONE);
@@ -30,8 +33,10 @@
3033
// phpcs:ignore Magento2.Security.LanguageConstruct, Magento2.Security.InsecureFunction
3134
echo serialize($files);
3235
} else {
36+
// phpcs:ignore Magento2.Security.LanguageConstruct
3337
echo "Command not unauthorized.";
3438
}
3539
} else {
40+
// phpcs:ignore Magento2.Security.LanguageConstruct
3641
echo "'token' or 'template' parameter is not set.";
3742
}

dev/tests/functional/utils/locales.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66
// phpcs:ignore Magento2.Security.IncludeFile
77
include __DIR__ . '/authenticate.php';
88

9+
// phpcs:ignore Magento2.Security.Superglobal
910
if (!empty($_POST['token'])) {
11+
// phpcs:ignore Magento2.Security.Superglobal
1012
if (authenticate(urldecode($_POST['token']))) {
13+
// phpcs:ignore Magento2.Security.Superglobal
1114
if ($_POST['type'] == 'deployed') {
15+
// phpcs:ignore Magento2.Security.Superglobal
1216
$themePath = isset($_POST['theme_path']) ? $_POST['theme_path'] : 'adminhtml/Magento/backend';
1317
$directory = __DIR__ . '/../../../../pub/static/' . $themePath;
18+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1419
$locales = array_diff(scandir($directory), ['..', '.']);
1520
} else {
1621
// phpcs:ignore Magento2.Security.IncludeFile
@@ -21,8 +26,10 @@
2126
// phpcs:ignore Magento2.Security.LanguageConstruct
2227
echo implode('|', $locales);
2328
} else {
29+
// phpcs:ignore Magento2.Security.LanguageConstruct
2430
echo "Command not unauthorized.";
2531
}
2632
} else {
33+
// phpcs:ignore Magento2.Security.LanguageConstruct
2734
echo "'token' parameter is not set.";
2835
}

dev/tests/functional/utils/log.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
// phpcs:ignore Magento2.Security.IncludeFile
88
include __DIR__ . '/authenticate.php';
99

10+
// phpcs:ignore Magento2.Security.Superglobal
1011
if (!empty($_POST['token']) && !empty($_POST['name'])) {
12+
// phpcs:ignore Magento2.Security.Superglobal
1113
if (authenticate(urldecode($_POST['token']))) {
14+
// phpcs:ignore Magento2.Security.Superglobal
1215
$name = urldecode($_POST['name']);
1316
if (preg_match('/\.\.(\\\|\/)/', $name)) {
1417
// phpcs:ignore Magento2.Exceptions.DirectThrow
@@ -18,8 +21,10 @@
1821
// phpcs:ignore Magento2.Security.InsecureFunction, Magento2.Functions.DiscouragedFunction, Magento2.Security.LanguageConstruct
1922
echo serialize(file_get_contents('../../../../var/log' . '/' . $name));
2023
} else {
24+
// phpcs:ignore Magento2.Security.LanguageConstruct
2125
echo "Command not unauthorized.";
2226
}
2327
} else {
28+
// phpcs:ignore Magento2.Security.LanguageConstruct
2429
echo "'token' or 'name' parameter is not set.";
2530
}

dev/tests/functional/utils/pathChecker.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
// phpcs:ignore Magento2.Security.IncludeFile
77
include __DIR__ . '/authenticate.php';
88

9+
// phpcs:ignore Magento2.Security.Superglobal
910
if (!empty($_POST['token']) && !empty($_POST['path'])) {
11+
// phpcs:ignore Magento2.Security.Superglobal
1012
if (authenticate(urldecode($_POST['token']))) {
13+
// phpcs:ignore Magento2.Security.Superglobal
1114
$path = urldecode($_POST['path']);
1215
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1316
if (file_exists('../../../../' . $path)) {
@@ -18,8 +21,10 @@
1821
echo 'path exists: false';
1922
}
2023
} else {
24+
// phpcs:ignore Magento2.Security.LanguageConstruct
2125
echo "Command not unauthorized.";
2226
}
2327
} else {
28+
// phpcs:ignore Magento2.Security.LanguageConstruct
2429
echo "'token' or 'path' parameter is not set.";
2530
}

dev/tests/functional/utils/website.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
// phpcs:ignore Magento2.Security.IncludeFile
77
include __DIR__ . '/authenticate.php';
88

9+
// phpcs:ignore Magento2.Security.Superglobal
910
if (!empty($_POST['token']) && !empty($_POST['website_code'])) {
11+
// phpcs:ignore Magento2.Security.Superglobal
1012
if (authenticate(urldecode($_POST['token']))) {
13+
// phpcs:ignore Magento2.Security.Superglobal
1114
$websiteCode = urldecode($_POST['website_code']);
1215
$rootDir = '../../../../';
1316
$websiteDir = $rootDir . 'websites/' . $websiteCode . '/';
@@ -35,8 +38,10 @@
3538
// phpcs:ignore Magento2.Functions.DiscouragedFunction
3639
file_put_contents($websiteDir . 'index.php', $contents);
3740
} else {
41+
// phpcs:ignore Magento2.Security.LanguageConstruct
3842
echo "Command not unauthorized.";
3943
}
4044
} else {
45+
// phpcs:ignore Magento2.Security.LanguageConstruct
4146
echo "'token' or 'website_code' parameter is not set.";
4247
}

0 commit comments

Comments
 (0)