public function testUninstallRemoveData() { $this->moduleRegistryUninstaller->expects($this->never())->method($this->anything()); $uninstall = $this->getMockForAbstractClass('Magento\\Framework\\Setup\\UninstallInterface', [], '', false); $uninstall->expects($this->atLeastOnce())->method('uninstall')->with($this->setup, $this->isInstanceOf('Magento\\Setup\\Model\\ModuleContext')); $this->collector->expects($this->once())->method('collectUninstall')->willReturn(['moduleA' => $uninstall, 'moduleB' => $uninstall]); $resource = $this->getMock('Magento\\Framework\\Module\\ModuleResource', [], [], '', false); $resource->expects($this->atLeastOnce())->method('getDbVersion')->willReturn('1.0'); $this->output->expects($this->atLeastOnce())->method('writeln'); $this->objectManager->expects($this->once())->method('get')->with('Magento\\Framework\\Module\\ModuleResource')->willReturn($resource); $this->uninstaller->uninstallData($this->output, ['moduleA', 'moduleB']); }
public function testExecuteAll() { $input = ['module' => ['Magento_A', 'Magento_B'], '-c' => true, '-r' => true]; $this->setUpExecute($input); $this->cleanupFiles->expects($this->once())->method('clearMaterializedViewFiles'); $uninstallMock = $this->getMockForAbstractClass('Magento\Framework\Setup\UninstallInterface', [], '', false); $uninstallMock->expects($this->once()) ->method('uninstall') ->with($this->setup, $this->isInstanceOf('Magento\Setup\Model\ModuleContext')); $this->uninstallCollector->expects($this->once()) ->method('collectUninstall') ->willReturn(['Magento_A' => $uninstallMock]); $this->tester->execute($input); }