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