Esempio n. 1
0
 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'));
 }