|
12 | 12 | }
|
13 | 13 |
|
14 | 14 | defined('PROJECT_ROOT') || define('PROJECT_ROOT', dirname(dirname(dirname(__DIR__))));
|
| 15 | + |
15 | 16 | require_once realpath(PROJECT_ROOT . '/vendor/autoload.php');
|
16 | 17 |
|
17 | 18 | //Load constants from .env file
|
18 |
| -defined('FW_BP') || define('FW_BP', PROJECT_ROOT); |
19 |
| - |
20 |
| -// add the debug flag here |
21 |
| -$debug_mode = $_ENV['MFTF_DEBUG'] ?? false; |
22 |
| -if (!(bool)$debug_mode && extension_loaded('xdebug')) { |
23 |
| - xdebug_disable(); |
24 |
| -} |
25 |
| - |
26 |
| -$RELATIVE_TESTS_MODULE_PATH = '/tests/functional/tests/MFTF'; |
27 |
| - |
28 |
| -defined('MAGENTO_BP') || define('MAGENTO_BP', PROJECT_ROOT); |
29 |
| -defined('TESTS_BP') || define('TESTS_BP', dirname(dirname(__DIR__))); |
30 |
| -defined('TESTS_MODULE_PATH') || define('TESTS_MODULE_PATH', realpath(TESTS_BP . $RELATIVE_TESTS_MODULE_PATH)); |
31 |
| - |
32 |
| -if (file_exists(TESTS_BP . DIRECTORY_SEPARATOR . '.env')) { |
33 |
| - $env = new \Dotenv\Loader(TESTS_BP . DIRECTORY_SEPARATOR . '.env'); |
| 19 | +$envFilePath = dirname(dirname(__DIR__)); |
| 20 | +if (file_exists($envFilePath . DIRECTORY_SEPARATOR . '.env')) { |
| 21 | + $env = new \Dotenv\Loader($envFilePath . DIRECTORY_SEPARATOR . '.env'); |
34 | 22 | $env->load();
|
35 | 23 |
|
36 | 24 | foreach ($_ENV as $key => $var) {
|
37 | 25 | defined($key) || define($key, $var);
|
38 | 26 | }
|
39 | 27 |
|
| 28 | + if (array_key_exists('MAGENTO_BP', $_ENV)) { |
| 29 | + // TODO REMOVE THIS CODE ONCE WE HAVE STOPPED SUPPORTING dev/tests/acceptance PATH |
| 30 | + // define TEST_PATH and TEST_MODULE_PATH |
| 31 | + defined('TESTS_BP') || define('TESTS_BP', realpath(MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance/')); |
| 32 | + |
| 33 | + $RELATIVE_TESTS_MODULE_PATH = '/tests/functional/Magento/FunctionalTest'; |
| 34 | + defined('TESTS_MODULE_PATH') || define( |
| 35 | + 'TESTS_MODULE_PATH', |
| 36 | + realpath(TESTS_BP . $RELATIVE_TESTS_MODULE_PATH) |
| 37 | + ); |
| 38 | + } |
| 39 | + |
40 | 40 | defined('MAGENTO_CLI_COMMAND_PATH') || define(
|
41 | 41 | 'MAGENTO_CLI_COMMAND_PATH',
|
42 | 42 | 'dev/tests/acceptance/utils/command.php'
|
|
56 | 56 | }
|
57 | 57 |
|
58 | 58 | }
|
| 59 | + |
| 60 | +defined('FW_BP') || define('FW_BP', PROJECT_ROOT); |
| 61 | +defined('MAGENTO_BP') || define('MAGENTO_BP', PROJECT_ROOT); |
| 62 | +defined('TESTS_BP') || define('TESTS_BP', dirname(dirname(__DIR__))); |
| 63 | + |
| 64 | +$RELATIVE_TESTS_MODULE_PATH = '/tests/functional/tests/MFTF'; |
| 65 | +defined('TESTS_MODULE_PATH') || define('TESTS_MODULE_PATH', realpath(TESTS_BP . $RELATIVE_TESTS_MODULE_PATH)); |
| 66 | + |
| 67 | + |
| 68 | +// add the debug flag here |
| 69 | +$debug_mode = $_ENV['MFTF_DEBUG'] ?? false; |
| 70 | +if (!(bool)$debug_mode && extension_loaded('xdebug')) { |
| 71 | + xdebug_disable(); |
| 72 | +} |
0 commit comments