Exemple #1
0
 public function testGetCommands()
 {
     $commands = ['Magento\\Setup\\Console\\Command\\AdminUserCreateCommand', 'Magento\\Setup\\Console\\Command\\ConfigSetCommand', 'Magento\\Setup\\Console\\Command\\DbDataUpgradeCommand', 'Magento\\Setup\\Console\\Command\\DbSchemaUpgradeCommand', 'Magento\\Setup\\Console\\Command\\DbStatusCommand', 'Magento\\Setup\\Console\\Command\\InfoCurrencyListCommand', 'Magento\\Setup\\Console\\Command\\InfoLanguageListCommand', 'Magento\\Setup\\Console\\Command\\InfoTimezoneListCommand', 'Magento\\Setup\\Console\\Command\\InstallCommand', 'Magento\\Setup\\Console\\Command\\InstallStoreConfigurationCommand', 'Magento\\Setup\\Console\\Command\\ModuleEnableCommand', 'Magento\\Setup\\Console\\Command\\ModuleDisableCommand', 'Magento\\Setup\\Console\\Command\\ModuleStatusCommand', 'Magento\\Setup\\Console\\Command\\MaintenanceAllowIpsCommand', 'Magento\\Setup\\Console\\Command\\MaintenanceDisableCommand', 'Magento\\Setup\\Console\\Command\\MaintenanceEnableCommand', 'Magento\\Setup\\Console\\Command\\MaintenanceStatusCommand', 'Magento\\Setup\\Console\\Command\\UpgradeCommand', 'Magento\\Setup\\Console\\Command\\UninstallCommand'];
     $index = 0;
     foreach ($commands as $command) {
         $this->serviceManager->expects($this->at($index++))->method('create')->with($command);
     }
     $this->commandList->getCommands();
 }
 public function setUp()
 {
     $this->application = $this->getMock('Zend\\Mvc\\Application', array(), array(), '', false);
     $this->event = $this->getMock('Zend\\Mvc\\MvcEvent');
     $this->serviceManager = $this->getMock('Zend\\ServiceManager\\ServiceManager');
     $this->cli = $this->getMock('Symfony\\Component\\Console\\Application', array('run'));
     $this->serviceManager->expects($this->any())->method('get')->with('doctrine.cli')->will($this->returnValue($this->cli));
     $this->application->expects($this->any())->method('getServiceManager')->will($this->returnValue($this->serviceManager));
     $this->event->expects($this->any())->method('getTarget')->will($this->returnValue($this->application));
 }
 /**
  * @covers \Magento\Setup\Controller\Session::testUnloginAction
  */
 public function testUnloginAction()
 {
     $this->objectManagerProvider->expects($this->once())->method('get')->will($this->returnValue($this->objectManager));
     $deployConfigMock = $this->getMock('Magento\\Framework\\App\\DeploymentConfig', ['isAvailable'], [], '', false);
     $deployConfigMock->expects($this->once())->method('isAvailable')->will($this->returnValue(true));
     $stateMock = $this->getMock('Magento\\Framework\\App\\State', ['setAreaCode'], [], '', false);
     $stateMock->expects($this->once())->method('setAreaCode');
     $sessionConfigMock = $this->getMock('Magento\\Backend\\Model\\Session\\AdminConfig', ['setCookiePath'], [], '', false);
     $sessionConfigMock->expects($this->once())->method('setCookiePath');
     $returnValueMap = [['Magento\\Framework\\App\\State', $stateMock], ['Magento\\Backend\\Model\\Session\\AdminConfig', $sessionConfigMock]];
     $this->serviceManager->expects($this->once())->method('get')->will($this->returnValue($deployConfigMock));
     $this->objectManager->expects($this->atLeastOnce())->method('get')->will($this->returnValueMap($returnValueMap));
     $sessionMock = $this->getMock('Magento\\Backend\\Model\\Auth\\Session', ['prolong'], [], '', false);
     $this->objectManager->expects($this->once())->method('create')->will($this->returnValue($sessionMock));
     $controller = new Session($this->serviceManager, $this->objectManagerProvider);
     $controller->prolongAction();
 }
 public function testGetCommands()
 {
     $this->serviceManager->expects($this->atLeastOnce())->method('create');
     $this->commandList->getCommands();
 }