public function testUninstallRemoveCode() { $this->moduleRegistryUninstaller->expects($this->never())->method($this->anything()); $this->output->expects($this->once())->method('writeln'); $packageInfoFactory = $this->getMock('Magento\\Framework\\Module\\PackageInfoFactory', [], [], '', false); $packageInfo = $this->getMock('Magento\\Framework\\Module\\PackageInfo', [], [], '', false); $packageInfo->expects($this->atLeastOnce())->method('getPackageName'); $packageInfoFactory->expects($this->once())->method('create')->willReturn($packageInfo); $this->objectManager->expects($this->once())->method('get')->with('Magento\\Framework\\Module\\PackageInfoFactory')->willReturn($packageInfoFactory); $this->remove->expects($this->once())->method('remove'); $this->uninstaller->uninstallCode($this->output, ['moduleA', 'moduleB']); }
public function testInteraction() { $input = ['module' => ['Magento_A', 'Magento_B']]; $this->setUpExecute(); $this->moduleUninstaller->expects($this->once())->method('uninstallCode')->with($this->isInstanceOf('Symfony\\Component\\Console\\Output\\OutputInterface'), $input['module']); $this->moduleRegistryUninstaller->expects($this->once())->method('removeModulesFromDb')->with($this->isInstanceOf('Symfony\\Component\\Console\\Output\\OutputInterface'), $input['module']); $this->moduleRegistryUninstaller->expects($this->once())->method('removeModulesFromDeploymentConfig')->with($this->isInstanceOf('Symfony\\Component\\Console\\Output\\OutputInterface'), $input['module']); $this->question->expects($this->once())->method('ask')->will($this->returnValue(false)); $this->helperSet->expects($this->once())->method('get')->with('question')->will($this->returnValue($this->question)); $this->command->setHelperSet($this->helperSet); $this->tester = new CommandTester($this->command); $this->tester->execute($input); }