_settings = $settings; $this->_envBootstrap = $envBootstrap; $this->_docBlockBootstrap = $docBlockBootstrap; $this->_profilerBootstrap = $profilerBootstrap; $this->_shell = $shell; $this->_application = $application; $this->memoryFactory = $memoryFactory; } /** * Retrieve the application instance * * @return Application */ public function getApplication() { return $this->_application; } /** * Perform bootstrap actions required to completely setup the testing environment */ public function runBootstrap() { $this->_envBootstrap->emulateHttpRequest($_SERVER); $this->_envBootstrap->emulateSession($_SESSION); $profilerOutputFile = $this->_settings->getAsFile('TESTS_PROFILER_FILE'); if ($profilerOutputFile) { $this->_profilerBootstrap->registerFileProfiler($profilerOutputFile); } $profilerBambooOutputFile = $this->_settings->getAsFile('TESTS_BAMBOO_PROFILER_FILE'); $profilerBambooMetricsFile = $this->_settings->getAsFile('TESTS_BAMBOO_PROFILER_METRICS_FILE'); if ($profilerBambooOutputFile && $profilerBambooMetricsFile) { $this->_profilerBootstrap->registerBambooProfiler($profilerBambooOutputFile, $profilerBambooMetricsFile); } $memoryBootstrap = $this->memoryFactory->create( $this->_settings->get('TESTS_MEM_USAGE_LIMIT', 0), $this->_settings->get('TESTS_MEM_LEAK_LIMIT', 0) ); $memoryBootstrap->activateStatsDisplaying(); $memoryBootstrap->activateLimitValidation(); $this->_docBlockBootstrap->registerAnnotations($this->_application); } }