public function testStartActionException()
 {
     $this->webLogger->expects($this->once())->method('clear');
     $this->installer->expects($this->once())->method('install')->willThrowException($this->getMock('\\Exception'));
     $jsonModel = $this->controller->startAction();
     $this->assertNull($jsonModel->getVariable('isSampleDataError'));
 }
 public function testExecute()
 {
     $this->deploymentConfig->expects($this->once())->method('isAvailable')->will($this->returnValue(true));
     $this->installer->expects($this->once())->method('installUserConfig');
     $this->installerFactory->expects($this->once())->method('create')->will($this->returnValue($this->installer));
     $tester = new CommandTester($this->command);
     $tester->execute([]);
 }
 public function testStartAction()
 {
     $this->webLogger->expects($this->once())->method('clear');
     $this->installer->expects($this->once())->method('install');
     $this->installer->expects($this->exactly(2))->method('getInstallInfo');
     $jsonModel = $this->controller->startAction();
     $this->assertInstanceOf('\\Zend\\View\\Model\\JsonModel', $jsonModel);
     $variables = $jsonModel->getVariables();
     $this->assertArrayHasKey('key', $variables);
     $this->assertArrayHasKey('success', $variables);
     $this->assertArrayHasKey('messages', $variables);
     $this->assertTrue($variables['success']);
 }
 /**
  * Test install command with invalid sales_order_increment_prefix value
  *
  * @expectedException \InvalidArgumentException
  * @dataProvider validateWithExceptionDataProvider
  * @param $prefixValue
  */
 public function testValidateWithException($prefixValue)
 {
     $this->installerFactory->expects($this->never())->method('create')->will($this->returnValue($this->installer));
     $this->installer->expects($this->never())->method('install');
     $this->input['--' . InstallCommand::INPUT_KEY_SALES_ORDER_INCREMENT_PREFIX] = $prefixValue;
     $commandTester = new CommandTester($this->command);
     $commandTester->execute($this->input);
 }
 public function testUninstallAction()
 {
     $this->installer->expects($this->once())->method('uninstall');
     $this->controller->uninstallAction();
 }
 public function testIndexActionCheckPrefix()
 {
     $this->installer->expects($this->once())->method('checkDatabaseTablePrefix');
     $this->controller->indexAction();
 }
 public function testExecuteInteractionNo()
 {
     $this->installer->expects($this->exactly(0))->method('uninstall');
     $this->installerFactory->expects($this->exactly(0))->method('create');
     $this->checkInteraction(false);
 }