本文整理汇总了PHP中Environment::activateModules方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::activateModules方法的具体用法?PHP Environment::activateModules怎么用?PHP Environment::activateModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::activateModules方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testModuleDeactivationInSubShop
/**
* Test check shop environment after module deactivation in subshop.
*
* @dataProvider providerModuleDeactivation
*
* @param array $aInstallModules
* @param string $sModuleId
* @param array $aResultToAssert
*/
public function testModuleDeactivationInSubShop($aInstallModules, $sModuleId, $aResultToAssert)
{
if ($this->getTestConfig()->getShopEdition() != 'EE') {
$this->markTestSkipped("This test case is only actual when SubShops are available.");
}
$oModule = oxNew('oxModule');
$oEnvironment = new Environment();
$oEnvironment->prepare($aInstallModules);
$oEnvironment->setShopId(2);
$oEnvironment->activateModules($aInstallModules);
$this->deactivateModule($oModule, $sModuleId);
$this->runAsserts($aResultToAssert);
}
示例2: testModuleActivationWithNewMetaDataWithSubshops
/**
* Tests when existing active module's meta data is changed and module activates and deactivates
* development process
*
* @dataProvider providerModuleNewMetaData
*
* @param array $aInstallModules
* @param string $sModule
* @param array $aMetaData
* @param array $aResultToAsserts
* @param array $aResultToAssertForSubShop
*/
public function testModuleActivationWithNewMetaDataWithSubshops($aInstallModules, $sModule, $aMetaData, $aResultToAsserts, $aResultToAssertForSubShop)
{
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);
$oEnvironment->setShopId(1);
$oModule = oxNew('oxModule');
$oModule->load($sModule);
$this->deactivateModule($oModule);
$oModule->setModuleData($aMetaData);
$this->activateModule($oModule);
$oEnvironment->setShopId(2);
$this->runAsserts($aResultToAssertForSubShop);
}
示例3: testModuleRemoveInSubShop
/**
* 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|PHPUnit_Framework_MockObject_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);
}
示例4: testIfNotReorderedOnSubShop
/**
* 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');
}