private function setUpExecute($input) { $this->setUpPassValidation(); $this->remove->expects($this->once())->method('remove')->with(['magento/package-a', 'magento/package-b']); $this->dependencyChecker->expects($this->once()) ->method('checkDependenciesWhenDisableModules') ->willReturn(['Magento_A' => [], 'Magento_B' => []]); $this->dataSetup->expects($this->exactly(count($input['module'])))->method('deleteTableRow'); $this->deploymentConfig->expects($this->once()) ->method('getConfigData') ->with(ConfigOptionsListConstants::KEY_MODULES) ->willReturn(['Magento_A' => 1, 'Magento_B' => 1, 'Magento_C' => 0, 'Magento_D' => 1]); $this->loader->expects($this->once()) ->method('load') ->with($input['module']) ->willReturn(['Magento_C' => [], 'Magento_D' => []]); $this->writer->expects($this->once()) ->method('saveConfig') ->with( [ ConfigFilePool::APP_CONFIG => [ConfigOptionsListConstants::KEY_MODULES => ['Magento_C' => 0, 'Magento_D' => 1]] ] ); $this->cache->expects($this->once())->method('clean'); $this->cleanupFiles->expects($this->once())->method('clearCodeGeneratedClasses'); }
public function testRemoveModulesFromDb() { $this->output->expects($this->atLeastOnce())->method('writeln'); $this->dataSetup->expects($this->atLeastOnce())->method('deleteTableRow'); $this->moduleRegistryUninstaller->removeModulesFromDb($this->output, ['moduleA', 'moduleB']); }