/** * Test check shop environment after module deactivation in subshop. * * @dataProvider providerModuleDeactivation * * @param array $aInstallModules * @param array $aRemovedExtensions * @param array $aResultToAssert */ public function testModuleRemoveInSubShop($aInstallModules, $aRemovedExtensions, $aResultToAssert) { if ($this->getTestConfig()->getShopEdition() != 'EE') { $this->markTestSkipped("This test case is only actual when SubShops are available."); } $oEnvironment = new Environment(); $oEnvironment->prepare($aInstallModules); $oEnvironment->setShopId(2); $oEnvironment->activateModules($aInstallModules); /** @var oxModuleList|MockObject $oModuleList */ $oModuleList = $this->getMock('oxModuleList', array('getDeletedExtensions')); $oModuleList->expects($this->any())->method('getDeletedExtensions')->will($this->returnValue($aRemovedExtensions)); $oModuleList->cleanup(); //Assert on subshop $this->runAsserts($aResultToAssert); $this->markTestIncomplete('Skipped till cleanup for subshops will be fixed'); //Assert on main shop $oEnvironment->setShopId(1); $this->runAsserts($aResultToAssert); }
/** * Tests check if changed extensions order stays the same after deactivation / activation * * @dataProvider providerModuleReorderExtensions * * @param array $aInstallModules * @param string $sModule * @param array $aReorderedExtensions * @param array $aNotReorderedExtensions */ public function testIfNotReorderedOnSubShop($aInstallModules, $sModule, $aReorderedExtensions, $aNotReorderedExtensions) { if ($this->getTestConfig()->getShopEdition() != 'EE') { $this->markTestSkipped("This test case is only actual when SubShops are available."); } $oConfig = oxRegistry::getConfig(); $oEnvironment = new Environment(); $oEnvironment->prepare($aInstallModules); $oValidator = new Validator($oConfig); $oModule = oxNew('oxModule'); $oEnvironment->setShopId(2); $oEnvironment->activateModules($aInstallModules); // load reordered extensions for shop $oEnvironment->setShopId(1); $oConfig->setConfigParam('aModules', $aReorderedExtensions); $oModule->load($sModule); $this->deactivateModule($oModule); $this->activateModule($oModule); $oEnvironment->setShopId(2); $this->assertTrue($oValidator->checkExtensions($aNotReorderedExtensions), 'Extension order changed'); }