$globalEtcFiles = "../../../app/etc/*.xml"; } $globalEtcFiles .= ';etc/integration-tests-config.xml'; if (defined('TESTS_MODULE_CONFIG_FILES') && TESTS_MODULE_CONFIG_FILES) { $moduleEtcFiles = TESTS_MODULE_CONFIG_FILES; } else { $moduleEtcFiles = "../../../app/etc/modules/*.xml"; } $developerMode = false; if (defined('TESTS_MAGENTO_DEVELOPER_MODE') && TESTS_MAGENTO_DEVELOPER_MODE == 'enabled') { $developerMode = true; } Magento_Test_Bootstrap::setInstance(new Magento_Test_Bootstrap(realpath("{$baseDir}/../../../"), $localXmlFile, $globalEtcFiles, $moduleEtcFiles, "{$baseDir}/tmp", $cleanupAction, $developerMode)); /* Enable profiler if necessary */ if (defined('TESTS_PROFILER_FILE') && TESTS_PROFILER_FILE) { Magento_Profiler::registerOutput(new Magento_Profiler_Output_Csvfile($baseDir . DIRECTORY_SEPARATOR . TESTS_PROFILER_FILE)); } /* Enable profiler with bamboo friendly output format */ if (defined('TESTS_BAMBOO_PROFILER_FILE') && defined('TESTS_BAMBOO_PROFILER_METRICS_FILE')) { Magento_Profiler::registerOutput(new Magento_Test_Profiler_OutputBamboo($baseDir . DIRECTORY_SEPARATOR . TESTS_BAMBOO_PROFILER_FILE, require $baseDir . DIRECTORY_SEPARATOR . TESTS_BAMBOO_PROFILER_METRICS_FILE)); } /* Activate custom annotations in doc comments */ /* * Note: order of registering (and applying) annotations is important. * To allow config fixtures to deal with fixture stores, data fixtures should be processed before config fixtures. */ Magento_Test_Listener::registerObserver('Magento_Test_Listener_Annotation_Isolation'); Magento_Test_Listener::registerObserver('Magento_Test_Listener_Annotation_Fixture'); Magento_Test_Listener::registerObserver('Magento_Test_Listener_Annotation_Config'); /* Unset declared global variables to release PHPUnit from maintaining their values between tests */ unset($baseDir, $localXmlFile, $globalEtcFiles, $moduleEtcFiles);
/** * Register observer classes within the listener */ public static function setUpBeforeClass() { Magento_Test_Listener::registerObserver('Magento_Test_ListenerTestObserverOne'); Magento_Test_Listener::registerObserver('Magento_Test_ListenerTestObserverTwo'); }