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


PHP oxRegistry::set方法代码示例

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


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

示例1: _prepareCurrentTime

 /**
  * @param int $iCurrentTime
  */
 private function _prepareCurrentTime($iCurrentTime)
 {
     $oUtilsDate = $this->getMock('oxUtilsDate', array('getTime'));
     $oUtilsDate->expects($this->any())->method('getTime')->will($this->returnValue($iCurrentTime));
     /** @var oxUtilsDate $oUtils */
     oxRegistry::set('oxUtilsDate', $oUtilsDate);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:10,代码来源:oxservercheckerTest.php

示例2: testColons

 /**
  * Test colon smarty modifier
  *
  * @dataProvider provider
  */
 public function testColons($sTranslation, $sResult)
 {
     $oLang = $this->getMock("oxLang", array("translateString"));
     $oLang->expects($this->any())->method("translateString")->with($this->equalTo('COLON'))->will($this->returnValue($sTranslation));
     oxRegistry::set('oxLang', $oLang);
     $this->assertEquals($sResult, smarty_modifier_colon('Name'));
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:12,代码来源:smartymodifiercolonTest.php

示例3: __construct

 /**
  * Class constructor.
  * Sets current module main data and loads the rest module info.
  */
 function __construct()
 {
     $sModuleId = 'oxpsmodulegenerator';
     $this->setModuleData(array('id' => $sModuleId, 'title' => 'OXID Module Skeleton Generator', 'description' => 'Folders structure, empty classes and metadata generation for new OXID eShop modules.'));
     $this->load($sModuleId);
     oxRegistry::set('oxpsModuleGeneratorModule', $this);
 }
开发者ID:suabo,项目名称:oxid_module_generator,代码行数:11,代码来源:oxpsmodulegeneratormodule.php

示例4: testAdminLoginWithOldPasswordMultishop

 /**
  * Tries to login with old password from different subshop, makes sure there are no crashes
  */
 public function testAdminLoginWithOldPasswordMultishop()
 {
     $this->setAdminMode(true);
     //faking cookie check
     $oUtils = $this->getMock("oxUtilsServer", array("getOxCookie"));
     $oUtils->expects($this->any())->method("getOxCookie")->will($this->returnValue(array("test" => "test")));
     oxRegistry::set("oxUtilsServer", $oUtils);
     //creating test admin user
     $oUser = $this->_createUser($this->_sDefaultUserName, $this->_sOldEncodedPassword, $this->_sOldSalt);
     //updating user over oxBase methods as oxUser restricts rights update
     $oUpdUser = oxNew('oxBase');
     $oUpdUser->init("oxuser");
     $oUpdUser->load($oUser->getId());
     $oUpdUser->oxuser__oxrights = new oxField(1);
     $oUpdUser->oxuser__oxshopid = new oxField(1);
     $oUpdUser->save();
     //set active shop 2
     oxRegistry::getConfig()->setShopId(2);
     //perform the login
     $this->_login($this->_sDefaultUserName, $this->_sDefaultUserPassword);
     $oUser->load($oUser->getId());
     $this->assertEquals(1, $oUser->oxuser__oxshopid->value, "User shop ID changed");
     $this->assertSame($oUser->getId(), oxRegistry::getSession()->getVariable('auth'), 'User ID is missing in session.');
     $this->assertNotSame($this->_sOldEncodedPassword, $oUser->oxuser__oxpassword->value, 'Old and new passwords must not match.');
     $this->assertNotSame($this->_sOldSalt, $oUser->oxuser__oxpasssalt->value, 'Old and new salt must not match.');
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:29,代码来源:loginTest.php

示例5: __construct

 /**
  * Class constructor.
  * Sets main module data and load additional data.
  */
 function __construct($sModuleTitle = 'Paymorrow Payments', $sModuleDescription = 'Paymorrow Payments Module')
 {
     $sModuleId = 'oxpspaymorrow';
     $this->setModuleData(array('id' => $sModuleId, 'title' => $sModuleTitle, 'description' => $sModuleDescription));
     $this->load($sModuleId);
     // Add the module class to oxRegistry
     oxRegistry::set('OxpsPaymorrowModule', $this);
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:12,代码来源:oxpspaymorrowmodule.php

示例6: _resetRegistry

 /**
  * Cleans up the registry before/after the test execution
  *
  * @return null;
  */
 protected function _resetRegistry()
 {
     $aRegKeys = oxRegistry::getKeys();
     $aSkippedClasses = array("oxconfigfile");
     foreach ($aRegKeys as $sKey) {
         if (!in_array($sKey, $aSkippedClasses)) {
             oxRegistry::set($sKey, null);
         }
     }
 }
开发者ID:alexschwarz89,项目名称:Barzahlen-OXID-4.7,代码行数:15,代码来源:OxidTestCase.php

示例7: testRender

 /**
  * Test view render.
  *
  * @return null
  */
 public function testRender()
 {
     $_SERVER['HTTP_COOKIE'] = "shop=1";
     $oView = oxNew('ClearCookies');
     $oUtilsServer = $this->getMock('oxUtilsServer', array('setOxCookie'));
     $oUtilsServer->expects($this->at(0))->method('setOxCookie')->with($this->equalTo('shop'));
     $oUtilsServer->expects($this->at(1))->method('setOxCookie')->with($this->equalTo('language'));
     $oUtilsServer->expects($this->at(2))->method('setOxCookie')->with($this->equalTo('displayedCookiesNotification'));
     oxRegistry::set('oxUtilsServer', $oUtilsServer);
     $this->assertEquals('page/info/clearcookies.tpl', $oView->render());
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:16,代码来源:clearcookiesTest.php

示例8: setUp

 /**
  * Set SUT state before test.
  */
 public function setUp()
 {
     parent::setUp();
     $this->SUT = $this->getMock('oxpsModulesConfigRequestValidator', array('__call', '_isReadableFile'));
     $this->SUT->expects($this->any())->method('_isReadableFile')->will($this->returnValue(true));
     // Content model mock
     $oContent = $this->getMock('oxpsModulesConfigContent', array('__call', 'getModulesList', 'getSettingsList'));
     $oContent->expects($this->any())->method('getModulesList')->will($this->returnValue(array('my_module' => (object) array('version' => '1.0.0'), 'good_extension' => (object) array('version' => '0.2.5'))));
     $oContent->expects($this->any())->method('getSettingsList')->will($this->returnValue(array('version' => 'Versions', 'extend' => 'Extended classes')));
     oxRegistry::set('oxpsModulesConfigContent', $oContent);
 }
开发者ID:suabo,项目名称:oxid_modules_config,代码行数:14,代码来源:oxpsModulesConfigRequestValidatorTest.php

示例9: testGetModulesList

 public function testGetModulesList()
 {
     // Config mock
     $oConfig = $this->getMock('oxConfig', array('getModulesDir'));
     $oConfig->expects($this->once())->method('getModulesDir')->will($this->returnValue('/shop/modules/'));
     oxRegistry::set('oxConfig', $oConfig);
     // Modules list mock
     $oModuleList = $this->getMock('oxModuleList', array('__call', 'getModulesFromDir'));
     $oModuleList->expects($this->once())->method('getModulesFromDir')->with('/shop/modules/')->will($this->returnValue(array('my_module' => (object) array('version' => '1.0.0'), 'oxpsmodulesconfig' => (object) array('version' => '0.1.0'), 'good_extension' => (object) array('version' => '0.2.5'))));
     oxTestModules::addModuleObject('oxModuleList', $oModuleList);
     $this->assertEquals(array('my_module' => (object) array('version' => '1.0.0'), 'good_extension' => (object) array('version' => '0.2.5')), $this->SUT->getModulesList());
 }
开发者ID:suabo,项目名称:oxid_modules_config,代码行数:12,代码来源:oxpsModulesConfigContentTest.php

示例10: testIncludeWidget

 public function testIncludeWidget()
 {
     $oReverseProxyBackend = $this->getMock("oxReverseProxyBackend", array("isActive"), array(), '', false);
     $oReverseProxyBackend->expects($this->any())->method("isActive")->will($this->returnValue(false));
     oxRegistry::set("oxReverseProxyBackend", $oReverseProxyBackend);
     $oShopControl = $this->getMock("oxWidgetControl", array("start"), array(), '', false);
     $oShopControl->expects($this->any())->method("start")->will($this->returnValue('html'));
     oxTestModules::addModuleObject('oxWidgetControl', $oShopControl);
     $oSmarty = new Smarty();
     $result = smarty_function_oxid_include_widget(array('cl' => 'oxwTagCloud', 'blShowTags' => 1), $oSmarty);
     $this->assertEquals('html', $result);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:12,代码来源:pluginsmartyoxincludewidgetTest.php

示例11: prepare

 /**
  * Test helper for test preparation.
  * Add given count of new languages.
  *
  * @param $count
  *
  * @return int
  */
 protected function prepare($count = 9)
 {
     for ($i = 0; $i < $count; $i++) {
         $languageName = chr(97 + $i) . chr(97 + $i);
         $languageId = $this->insertLanguage($languageName);
     }
     //we need a fresh instance of language object in registry,
     //otherwise stale data is used for language abbreviations.
     oxRegistry::set('oxLang', null);
     oxRegistry::set('oxTableViewNameGenerator', null);
     $this->updateViews();
     return $languageId;
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:21,代码来源:MultilanguageTestCase.php

示例12: testProcess_ProcessingOfServiceResponse_CommentAdded

 /**
  * Testing addition of comment after PayPal request processing
  */
 public function testProcess_ProcessingOfServiceResponse_CommentAdded()
 {
     $oUtilsDate = $this->getMock('oxUtilsDate', array('getTime'));
     $oUtilsDate->expects($this->any())->method('getTime')->will($this->returnValue(1410431540));
     oxRegistry::set('oxUtilsDate', $oUtilsDate);
     $sComment = 'testComment';
     $oComment = new oePayPalOrderPaymentComment();
     $oComment->setComment($sComment);
     $oPayPalResponse = $this->_getPayPalResponse();
     $oPayment = $this->_getPayment();
     $oPayment->expects($this->once())->method('addComment')->with($this->equalTo($oComment));
     $oPaymentList = $this->_getPaymentList(array('addPayment'));
     $oPaymentList->expects($this->any())->method('addPayment')->will($this->returnValue($oPayment));
     $oOrder = $this->_getOrder(array('getPaymentList'));
     $oOrder->expects($this->any())->method('getPaymentList')->will($this->returnValue($oPaymentList));
     $oData = $this->_getData();
     $oData->expects($this->any())->method('getComment')->will($this->returnValue($sComment));
     $oAction = $this->_getAction($oPayPalResponse, $oOrder, $oData);
     $oAction->process();
 }
开发者ID:Juergen-Busch,项目名称:paypal,代码行数:23,代码来源:oepaypalordercaptureactionTest.php

示例13: testToWishList

 /**
  * Testing oxcmp_utils::toWishList()
  *
  * @return null
  */
 public function testToWishList()
 {
     /** @var oxSession|PHPUnit_Framework_MockObject_MockObject $oSession */
     $oSession = $this->getMock('oxSession', array('checkSessionChallenge'));
     $oSession->expects($this->exactly(2))->method('checkSessionChallenge')->will($this->returnValue(true));
     oxRegistry::set('oxSession', $oSession);
     $this->getConfig()->setConfigParam("bl_showWishlist", false);
     /** @var oxcmp_utils|PHPUnit_Framework_MockObject_MockObject $oCmp */
     $oCmp = $this->getMock("oxcmp_utils", array("_toList"));
     $oCmp->expects($this->never())->method('_toList');
     $oCmp->toWishList('1126', 999, 'sel');
     $this->getConfig()->setConfigParam("bl_showWishlist", true);
     /** @var oxcmp_utils|PHPUnit_Framework_MockObject_MockObject $oCmp */
     $oCmp = $this->getMock("oxcmp_utils", array("_toList"));
     $oCmp->expects($this->once())->method('_toList')->with($this->equalTo('wishlist'), $this->equalTo('1126'), $this->equalTo(999), $this->equalTo('sel'));
     $oCmp->toWishList('1126', 999, 'sel');
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:22,代码来源:oxcmputilsTest.php

示例14: setToRegistryOxUtilsUrlMock

 /**
  * @param string $entryPoint
  */
 private function setToRegistryOxUtilsUrlMock($entryPoint)
 {
     $utilsUrl = $this->getMock('oxUtilsUrl');
     $utilsUrl->expects($this->atLeastOnce())->method('processUrl')->with($this->identicalTo($this->shopUrl . $entryPoint, false))->will($this->returnValue($this->shopUrl . $entryPoint . '?'));
     oxRegistry::set('oxUtilsUrl', $utilsUrl);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:9,代码来源:oxconfigTest.php

示例15: testActionSubmit_importSuccess

 public function testActionSubmit_importSuccess()
 {
     // Config mock
     $oConfig = $this->getMock('oxConfig', array('getUploadedFile'));
     $oConfig->expects($this->once())->method('getUploadedFile')->with('oxpsmodulesconfig_file')->will($this->returnValue(array('error' => '', 'type' => 'application/octet-stream', 'tmp_name' => '/path/to/good_file.json')));
     oxRegistry::set('oxConfig', $oConfig);
     modConfig::setRequestParameter('oxpsmodulesconfig_modules', array('my_module'));
     modConfig::setRequestParameter('oxpsmodulesconfig_settings', array('version' => 1, 'extend' => 1));
     modConfig::setRequestParameter('oxpsmodulesconfig_import', 1);
     // Request validator instance mock
     $oValidator = $this->getMock('oxpsModulesConfigRequestValidator', array('__call', 'validateRequestData', 'validateImportData', 'addErrors'));
     $oValidator->expects($this->once())->method('validateRequestData')->with(array('modules' => array('my_module'), 'settings' => array('version', 'extend'), 'action' => 'import'))->will($this->returnValue(true));
     $oValidator->expects($this->once())->method('validateImportData')->with(array('error' => '', 'type' => 'application/octet-stream', 'tmp_name' => '/path/to/good_file.json'))->will($this->returnValue(true));
     $oValidator->expects($this->never())->method('addErrors');
     oxRegistry::set('oxpsModulesConfigRequestValidator', $oValidator);
     // Configuration data transfer handler mock
     $oConfigTransfer = $this->getMock('oxpsModulesConfigTransfer', array('__call', 'backupToFile', 'setImportDataFromFile', 'importData', 'getImportErrors'));
     $oConfigTransfer->expects($this->once())->method('backupToFile')->with(array('modules' => array('my_module', 'good_extension'), 'settings' => array('version', 'extend', 'files'), 'action' => ''), 'full_backup')->will($this->returnValue(true));
     $oConfigTransfer->expects($this->once())->method('setImportDataFromFile')->with(array('error' => '', 'type' => 'application/octet-stream', 'tmp_name' => '/path/to/good_file.json'));
     $oConfigTransfer->expects($this->once())->method('importData')->with(array('modules' => array('my_module'), 'settings' => array('version', 'extend'), 'action' => 'import'))->will($this->returnValue(true));
     $oConfigTransfer->expects($this->never())->method('getImportErrors');
     oxTestModules::addModuleObject('oxpsModulesConfigTransfer', $oConfigTransfer);
     // Content model mock
     $oContent = $this->getMock('oxpsModulesConfigContent', array('__call', 'getModulesList', 'getSettingsList'));
     $oContent->expects($this->once())->method('getModulesList')->will($this->returnValue(array('my_module' => (object) array('version' => '1.0.0'), 'good_extension' => (object) array('version' => '0.2.5'))));
     $oContent->expects($this->once())->method('getSettingsList')->will($this->returnValue(array('version' => 'Versions', 'extend' => 'Extended classes', 'files' => 'New classes')));
     oxRegistry::set('oxpsModulesConfigContent', $oContent);
     // Module instance mock
     $oModule = $this->getMock('oxpsModulesConfigModule', array('__construct', '__call', 'clearTmp'));
     //$oModule->expects($this->once())->method('clearTmp');
     oxTestModules::addModuleObject('oxpsModulesConfigModule', $oModule);
     $this->SUT->actionSubmit();
     $this->assertSame('import', $this->SUT->getAction());
     $this->assertSame(array('OXPS_MODULESCONFIG_MSG_BACKUP_SUCCESS', 'OXPS_MODULESCONFIG_MSG_IMPORT_SUCCESS'), $this->SUT->getMessages());
 }
开发者ID:suabo,项目名称:oxid_modules_config,代码行数:35,代码来源:Admin_oxpsModulesConfigDashboardTest.php


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