示例#1
0
 public function testRunBootstrapAppInstall()
 {
     $adminUserName = \Magento\TestFramework\Bootstrap::ADMIN_NAME;
     $adminPassword = \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD;
     $adminRoleName = \Magento\TestFramework\Bootstrap::ADMIN_ROLE_NAME;
     $application = $this->_injectApplicationMock();
     $application->expects($this->once())->method('isInstalled')->will($this->returnValue(false));
     $application->expects($this->once())->method('install')->with($adminUserName, $adminPassword, $adminRoleName);
     $application->expects($this->never())->method('initialize');
     $application->expects($this->never())->method('cleanup');
     $this->_object->runBootstrap();
 }
 public function testRunBootstrapProfilerEnabled()
 {
     $memoryBootstrap = $this->getMock('Magento\\TestFramework\\Bootstrap\\Memory', ['activateStatsDisplaying', 'activateLimitValidation'], [], '', false);
     $memoryBootstrap->expects($this->once())->method('activateStatsDisplaying');
     $memoryBootstrap->expects($this->once())->method('activateLimitValidation');
     $this->memoryFactory->expects($this->once())->method('create')->with(0, 0)->will($this->returnValue($memoryBootstrap));
     $settingsMap = [['TESTS_PROFILER_FILE', '', 'profiler.csv'], ['TESTS_BAMBOO_PROFILER_FILE', '', 'profiler_bamboo.csv'], ['TESTS_BAMBOO_PROFILER_METRICS_FILE', '', 'profiler_metrics.php']];
     $this->_settings->expects($this->any())->method('getAsFile')->will($this->returnValueMap($settingsMap));
     $this->_profilerBootstrap->expects($this->once())->method('registerFileProfiler')->with("profiler.csv");
     $this->_profilerBootstrap->expects($this->once())->method('registerBambooProfiler')->with("profiler_bamboo.csv", "profiler_metrics.php");
     $this->_object->runBootstrap();
 }