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


PHP Mage_Core_Model_Store::setConfig方法代码示例

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


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

示例1: testGetBaseUrl

 /**
  * Isolation is enabled, as we pollute config with rewrite values
  *
  * @param string $type
  * @param bool $useRewrites
  * @param bool $useStoreCode
  * @param string $expected
  * @dataProvider getBaseUrlDataProvider
  * @magentoAppIsolation enabled
  */
 public function testGetBaseUrl($type, $useRewrites, $useStoreCode, $expected)
 {
     /* config operations require store to be loaded */
     $this->_model->load('default');
     $this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_USE_REWRITES, $useRewrites);
     $this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL, $useStoreCode);
     $actual = $this->_model->getBaseUrl($type);
     $this->assertEquals($expected, $actual);
 }
开发者ID:relue,项目名称:magento2,代码行数:19,代码来源:StoreTest.php

示例2: testGetProductNrRiskCheckAdvanced

 public function testGetProductNrRiskCheckAdvanced()
 {
     $path = 'scoring/buergel/services';
     $this->store->resetConfig();
     $this->store->setConfig($path, Netresearch_Buergel_Model_System_Source_Service::RISKCHECK_ADVANCED);
     $this->config = Mage::getModel('buergel/config');
     $this->config->reset();
     $this->config->setIsCompanyAddress(false);
     $this->assertEquals(Netresearch_Buergel_Model_System_Source_Service::RISKCHECK_ADVANCED, $this->config->getProductNr());
     $this->config->setIsCompanyAddress();
     $this->assertEquals(Netresearch_Buergel_Model_System_Source_Service::RISKCHECK_ADVANCED, $this->config->getProductNr());
     $this->config->reset();
 }
开发者ID:kirchbergerknorr,项目名称:netresearch_buergel,代码行数:13,代码来源:ConfigTest.php

示例3: testCanShowRetoureLink

 /**
  * @loadFixture ../../../var/fixtures/customers.yaml
  * @loadFixture ../../../var/fixtures/orders.yaml
  */
 public function testCanShowRetoureLink()
 {
     $this->setUp();
     $this->store->setConfig('intraship/dhlonlineretoure/active', '1');
     $customerId = 4;
     $orderId = 12;
     /* @var $customer Mage_Customer_Model_Customer */
     $customer = Mage::getModel("customer/customer")->load($customerId);
     /* @var $order Mage_Sales_Model_Order */
     $order = Mage::getModel("sales/order")->load($orderId);
     //Default case, no parameters given
     $this->assertFalse($this->getValidateHelper()->canShowRetoureLink($order));
     // internal request
     Mage::app()->getRequest()->setParam('hash', '1');
     $this->assertFalse($this->getValidateHelper()->canShowRetoureLink($order));
     // external request
     Mage::app()->getRequest()->clearParams();
     Mage::app()->getRequest()->setParam('order_id', $orderId);
     // prepare customer for retoure link
     $session = $this->getModelMock('customer/session', array('isLoggedIn', 'init', 'renewSession', 'start'));
     $session->expects($this->any())->method('isLoggedIn')->will($this->returnValue(true));
     $this->replaceByMock('singleton', 'customer/session', $session);
     $customerHelper = $this->getHelperMock('customer/data', array('getCustomer'));
     $customerHelper->expects($this->any())->method('getCustomer')->will($this->returnValue($customer));
     $this->replaceByMock('helper', 'customer/data', $customerHelper);
     // prepare config settings for retoure link
     $deliveryIso = $order->getShippingAddress()->getCountryId();
     $deliveryName = 'Delivery' . $deliveryIso;
     $data = array(array('iso' => $deliveryIso, 'name' => $deliveryName));
     $this->store->setConfig('intraship/dhlonlineretoure/delivery_names', serialize($data));
     $this->store->setConfig('intraship/dhlonlineretoure/allowed_shipping_methods', "flatrate_flatrate");
     $this->assertTrue($this->getValidateHelper()->canShowRetoureLink($order));
 }
开发者ID:igorvasiliev4,项目名称:magento_code,代码行数:37,代码来源:ValidateTest.php

示例4: testGetBaseUrlForCustomEntryPoint

 /**
  * Isolation is enabled, as we pollute config with rewrite values
  *
  * @param string $type
  * @param bool $useCustomEntryPoint
  * @param bool $useStoreCode
  * @param string $expected
  * @dataProvider getBaseUrlForCustomEntryPointDataProvider
  * @magentoAppIsolation enabled
  */
 public function testGetBaseUrlForCustomEntryPoint($type, $useCustomEntryPoint, $useStoreCode, $expected)
 {
     /* config operations require store to be loaded */
     $this->_model->load('default');
     $this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_USE_REWRITES, false);
     $this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL, $useStoreCode);
     // emulate custom entry point
     $_SERVER['SCRIPT_FILENAME'] = 'custom_entry.php';
     if ($useCustomEntryPoint) {
         Mage::register('custom_entry_point', true);
     }
     $actual = $this->_model->getBaseUrl($type);
     $this->assertEquals($expected, $actual);
 }
开发者ID:rorteg,项目名称:magento2,代码行数:24,代码来源:StoreTest.php

示例5: createPaymentMethodFromHpp

 /**
  * @param string $methodCode ideal,mc,etc.
  * @param array $methodData
  */
 public function createPaymentMethodFromHpp($methodCode, $methodData = array(), Mage_Core_Model_Store $store, $sortOrder)
 {
     $methodNewCode = 'adyen_hpp_' . $methodCode;
     if ($methodCode == 'ideal') {
         $methodNewCode = 'adyen_ideal';
         // enable adyen Ideal
         $store->setConfig('payment/adyen_ideal/active', 1);
     } else {
         $methodData = $methodData + Mage::getStoreConfig('payment/adyen_hpp', $store);
         $methodData['model'] = 'adyen/adyen_hpp';
     }
     foreach ($methodData as $key => $value) {
         if (is_object($value) || is_array($value)) {
             $value = json_encode($value);
         }
         $store->setConfig('payment/' . $methodNewCode . '/' . $key, $value);
     }
     $store->setConfig('/payment/' . $methodNewCode . '/sort_order', $sortOrder);
 }
开发者ID:miltoncff,项目名称:magento,代码行数:23,代码来源:Observer.php


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