当前位置: 首页>>代码示例>>PHP>>正文


PHP Environment::activateModules方法代码示例

本文整理汇总了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);
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:22,代码来源:ModuleDeactivationTest.php

示例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);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:30,代码来源:moduleactivationwithnewmetadataTest.php

示例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);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:29,代码来源:moduleremoveTest.php

示例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');
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:31,代码来源:moduleextensionsortTest.php


注:本文中的Environment::activateModules方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。