/** * Runs all asserts * * @param array $aExpectedResult */ protected function runAsserts($aExpectedResult) { $oConfig = oxRegistry::getConfig(); $oValidator = new Validator($oConfig); if (isset($aExpectedResult['blocks'])) { $this->assertTrue($oValidator->checkBlocks($aExpectedResult['blocks']), 'Blocks do not match expectations'); } if (isset($aExpectedResult['extend'])) { $this->assertTrue($oValidator->checkExtensions($aExpectedResult['extend']), 'Extensions do not match expectations'); } if (isset($aExpectedResult['files'])) { $this->assertTrue($oValidator->checkFiles($aExpectedResult['files']), 'Files do not match expectations'); } if (isset($aExpectedResult['events'])) { $this->assertTrue($oValidator->checkEvents($aExpectedResult['events']), 'Events do not match expectations'); } if (isset($aExpectedResult['settings'])) { $this->assertTrue($oValidator->checkConfigAmount($aExpectedResult['settings']), 'Configs do not match expectations'); } if (isset($aExpectedResult['versions'])) { $this->assertTrue($oValidator->checkVersions($aExpectedResult['versions']), 'Versions do not match expectations'); } if (isset($aExpectedResult['templates'])) { $this->assertTrue($oValidator->checkTemplates($aExpectedResult['templates']), 'Templates do not match expectations'); } if (isset($aExpectedResult['disabledModules'])) { $this->assertTrue($oValidator->checkDisabledModules($aExpectedResult['disabledModules']), 'Disabled modules do not match expectations'); } if (isset($aExpectedResult['settings_values'])) { $this->assertTrue($oValidator->checkConfigValues($aExpectedResult['settings_values']), 'Config values does not match expectations'); } }
/** * 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'); }