/** * Constructor * * @param \Magento\TestFramework\Bootstrap\Settings $settings, * @param \Magento\TestFramework\Bootstrap\Environment $envBootstrap, * @param \Magento\TestFramework\Bootstrap\DocBlock $docBlockBootstrap, * @param \Magento\TestFramework\Bootstrap\Profiler $profilerBootstrap * @param \Magento\Framework\Shell $shell * @param string $tmpDir */ public function __construct(\Magento\TestFramework\Bootstrap\Settings $settings, \Magento\TestFramework\Bootstrap\Environment $envBootstrap, \Magento\TestFramework\Bootstrap\DocBlock $docBlockBootstrap, \Magento\TestFramework\Bootstrap\Profiler $profilerBootstrap, \Magento\Framework\Shell $shell, $tmpDir) { $this->_settings = $settings; $this->_envBootstrap = $envBootstrap; $this->_docBlockBootstrap = $docBlockBootstrap; $this->_profilerBootstrap = $profilerBootstrap; $this->_shell = $shell; $this->_tmpDir = $tmpDir; $this->_application = $this->_createApplication(array($this->_settings->getAsConfigFile('TESTS_LOCAL_CONFIG_FILE'), $this->_settings->getAsConfigFile('TESTS_LOCAL_CONFIG_EXTRA_FILE')), $this->_settings->get('TESTS_GLOBAL_CONFIG_DIR'), $this->_settings->getAsMatchingPaths('TESTS_MODULE_CONFIG_FILES'), $this->_settings->get('TESTS_MAGENTO_MODE')); }
/** * @param string $settingName * @param string $expectedExceptionMsg * @dataProvider getAsConfigFileExceptionDataProvider */ public function testGetAsConfigFileException($settingName, $expectedExceptionMsg) { $this->setExpectedException('Magento\\Framework\\Exception\\LocalizedException', $expectedExceptionMsg); $this->_object->getAsConfigFile($settingName); }
// => memory usage limit // TEST_MEM_LEAK_LIMIT // => check for memory leaks // TESTS_ERROR_LOG_LISTENER_LEVEL // => Minimum error log level to listen for. Possible values: -1 ignore all errors, and level constants form http://tools.ietf.org/html/rfc5424 standard // TESTS_EXTRA_VERBOSE_LOG // => More verbose output $settings = new Settings(__DIR__, ['TESTS_INSTALL_CONFIG_FILE' => 'config' . DIRECTORY_SEPARATOR . 'install-config-mysql.php', 'TESTS_GLOBAL_CONFIG_FILE' => 'config' . DIRECTORY_SEPARATOR . 'config-global.php', 'TESTS_GLOBAL_CONFIG_DIR' => $magentoBaseDir . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'etc', 'TESTS_CLEANUP' => 'disabled', 'TESTS_MAGENTO_MODE' => 'developer']); // I think this is responsible for rendering test output. Not sure if it // is truly necessary with Behat tests or if this is really only needed for // Magento's integration tests. $shell = new Shell(new CommandRenderer()); // Configuration files specifically for the testing context. The // installConfigFile contains configuration for connecting to the test // database and accessing the admin. $installConfigFile = $settings->getAsConfigFile('TESTS_INSTALL_CONFIG_FILE'); if (!file_exists($installConfigFile)) { $installConfigFile .= '.dist'; } // Additional Magento configuration for the testing context. // @TODO What configuration can be set this way? $globalConfigFile = $settings->getAsConfigFile('TESTS_GLOBAL_CONFIG_FILE'); if (!file_exists($globalConfigFile)) { $globalConfigFile .= '.dist'; } // Create a sandbox directory for configuration, generated, cache, session // and related files created for the test context. $sandboxUniqueId = md5(sha1_file($installConfigFile)); $installDir = "{$testsTmpDir}/sandbox-{$settings->get('TESTS_PARALLEL_THREAD', 0)}-{$sandboxUniqueId}"; // Create the application - M2 application context for the test run. $application = new Application($shell, $installDir, $installConfigFile, $globalConfigFile, $settings->get('TESTS_GLOBAL_CONFIG_DIR'), $settings->get('TESTS_MAGENTO_MODE'), AutoloaderRegistry::getAutoloader());