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


PHP Environment::setShopId方法代码示例

本文整理汇总了PHP中Environment::setShopId方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::setShopId方法的具体用法?PHP Environment::setShopId怎么用?PHP Environment::setShopId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Environment的用法示例。


在下文中一共展示了Environment::setShopId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: testModuleActivationInMainShopDidNotActivatedInSubShop

 /**
  * Tests if module was activated.
  *
  * @dataProvider providerModuleActivation
  *
  * @param array  $aInstallModules
  * @param string $sModule
  * @param array  $aResultToAsserts
  */
 public function testModuleActivationInMainShopDidNotActivatedInSubShop($aInstallModules, $sModule, $aResultToAsserts)
 {
     if ($this->getTestConfig()->getShopEdition() != 'EE') {
         $this->markTestSkipped("This test case is only actual when SubShops are available.");
     }
     $oEnvironment = new Environment();
     $oEnvironment->prepare($aInstallModules);
     $oModule = oxNew('oxModule');
     $oEnvironment->setShopId(2);
     $oEnvironment->activateModules($aInstallModules);
     $oEnvironment->setShopId(1);
     $this->activateModule($oModule, $sModule);
     $oEnvironment->setShopId(2);
     $this->activateModule($oModule, $sModule);
     $oEnvironment->setShopId(1);
     $this->deactivateModule($oModule, $sModule);
     $oEnvironment->setShopId(2);
     $this->runAsserts($aResultToAsserts);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:28,代码来源:moduleactivationfirstTest.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::setShopId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。