From e95fb10d3a55d72af5d60e07703d09201812599e Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 18 Nov 2020 12:18:26 -0600 Subject: [PATCH 1/2] MQE-2391: [GitHub Issue] Magento fails with xdebug 3 due to mftf --- dev/tests/functional/standalone_bootstrap.php | 3 --- src/Magento/FunctionalTestingFramework/_bootstrap.php | 3 --- 2 files changed, 6 deletions(-) diff --git a/dev/tests/functional/standalone_bootstrap.php b/dev/tests/functional/standalone_bootstrap.php index 58030231d..49e6be69b 100755 --- a/dev/tests/functional/standalone_bootstrap.php +++ b/dev/tests/functional/standalone_bootstrap.php @@ -74,6 +74,3 @@ // add the debug flag here $debug_mode = $_ENV['MFTF_DEBUG'] ?? false; -if (!(bool)$debug_mode && extension_loaded('xdebug')) { - xdebug_disable(); -} diff --git a/src/Magento/FunctionalTestingFramework/_bootstrap.php b/src/Magento/FunctionalTestingFramework/_bootstrap.php index b655fb28e..d12e5ab8d 100644 --- a/src/Magento/FunctionalTestingFramework/_bootstrap.php +++ b/src/Magento/FunctionalTestingFramework/_bootstrap.php @@ -77,6 +77,3 @@ // add the debug flag here $debugMode = $_ENV['MFTF_DEBUG'] ?? false; -if (!(bool)$debugMode && extension_loaded('xdebug')) { - xdebug_disable(); -} From 6d6a7c59fc789625345c0b7b071fe08ea68b487b Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 24 Nov 2020 14:19:01 -0600 Subject: [PATCH 2/2] MQE-2391: [GitHub Issue] Magento fails with xdebug 3 due to mftf --- dev/tests/functional/standalone_bootstrap.php | 4 ---- .../Config/MftfApplicationConfig.php | 10 ++++------ src/Magento/FunctionalTestingFramework/_bootstrap.php | 3 --- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/dev/tests/functional/standalone_bootstrap.php b/dev/tests/functional/standalone_bootstrap.php index 49e6be69b..5ce6f029a 100755 --- a/dev/tests/functional/standalone_bootstrap.php +++ b/dev/tests/functional/standalone_bootstrap.php @@ -70,7 +70,3 @@ $RELATIVE_TESTS_MODULE_PATH = '/tests/functional/tests/MFTF'; defined('TESTS_MODULE_PATH') || define('TESTS_MODULE_PATH', realpath(TESTS_BP . $RELATIVE_TESTS_MODULE_PATH)); - - -// add the debug flag here -$debug_mode = $_ENV['MFTF_DEBUG'] ?? false; diff --git a/src/Magento/FunctionalTestingFramework/Config/MftfApplicationConfig.php b/src/Magento/FunctionalTestingFramework/Config/MftfApplicationConfig.php index ab06b5612..3aad73a06 100644 --- a/src/Magento/FunctionalTestingFramework/Config/MftfApplicationConfig.php +++ b/src/Magento/FunctionalTestingFramework/Config/MftfApplicationConfig.php @@ -100,17 +100,15 @@ private function __construct( $this->phase = $phase; $this->verboseEnabled = $verboseEnabled; - if (isset($debugLevel) && !in_array(strtolower($debugLevel), self::MFTF_DEBUG_LEVEL)) { + if (!in_array(strtolower($debugLevel), self::MFTF_DEBUG_LEVEL)) { throw new TestFrameworkException("{$debugLevel} is not a debug level. Use 'DEFAULT' or 'DEVELOPER'"); } switch (strtolower($debugLevel)) { - case self::LEVEL_DEVELOPER: case self::LEVEL_DEFAULT: - $this->debugLevel = $debugLevel; + $this->debugLevel = self::LEVEL_DEFAULT; break; - case null: + default: $this->debugLevel = self::LEVEL_DEVELOPER; - break; } $this->allowSkipped = $allowSkipped; $this->filterList = new FilterList($filters); @@ -196,7 +194,7 @@ public function verboseEnabled() */ public function getDebugLevel() { - return $this->debugLevel ?? getenv('MFTF_DEBUG'); + return $this->debugLevel; } /** diff --git a/src/Magento/FunctionalTestingFramework/_bootstrap.php b/src/Magento/FunctionalTestingFramework/_bootstrap.php index d12e5ab8d..9c13eaa54 100644 --- a/src/Magento/FunctionalTestingFramework/_bootstrap.php +++ b/src/Magento/FunctionalTestingFramework/_bootstrap.php @@ -74,6 +74,3 @@ 'TESTS_MODULE_PATH', realpath(TESTS_BP . $RELATIVE_TESTS_MODULE_PATH) ); - -// add the debug flag here -$debugMode = $_ENV['MFTF_DEBUG'] ?? false;