本文整理匯總了PHP中Magento\Customer\Helper\Address::canShowConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP Address::canShowConfig方法的具體用法?PHP Address::canShowConfig怎麽用?PHP Address::canShowConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Customer\Helper\Address
的用法示例。
在下文中一共展示了Address::canShowConfig方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetConfigCanShowConfig
public function testGetConfigCanShowConfig()
{
$result = ['key1' => 'value1', 'key2' => 'value2'];
$store = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock();
$store->expects($this->any())->method('getWebsiteId')->will($this->returnValue('1'));
$this->scopeConfig->expects($this->once())->method('getValue')->with('customer/address', \Magento\Framework\Store\ScopeInterface::SCOPE_STORE, $store)->will($this->returnValue($result));
$this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($store));
$this->assertNull($this->helper->getConfig('unavailable_key'));
$this->assertFalse($this->helper->canShowConfig('unavailable_key'));
$this->assertEquals($result['key1'], $this->helper->getConfig('key1'));
$this->assertEquals($result['key2'], $this->helper->getConfig('key2'));
$this->assertTrue($this->helper->canShowConfig('key1'));
$this->assertTrue($this->helper->canShowConfig('key2'));
}