本文整理汇总了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);
}
示例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();
}
示例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));
}
示例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);
}
示例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);
}