_scopeConfig = $this->getMockBuilder( \Magento\Framework\App\Config\ScopeConfigInterface::class )->getMock(); $this->_catalogConfig = $this->getMockBuilder(\Magento\Catalog\Model\Config::class) ->disableOriginalConstructor() ->getMock(); $this->_attributeConfig = $this->getMockBuilder(\Magento\Catalog\Model\Attribute\Config::class) ->disableOriginalConstructor() ->getMock(); $this->model = new Config($this->_scopeConfig, $this->_catalogConfig, $this->_attributeConfig); } public function testGetProductAttributes() { $expectedResult = ['attribute_one', 'attribute_two', 'attribute_three']; $this->_catalogConfig->expects($this->once()) ->method('getProductAttributes') ->willReturn(['attribute_one', 'attribute_two']); $this->_attributeConfig->expects($this->once()) ->method('getAttributeNames') ->with('wishlist_item') ->willReturn(['attribute_three']); $this->assertEquals($expectedResult, $this->model->getProductAttributes()); } public function testGetSharingEmailLimit() { $this->assertEquals(Config::SHARING_EMAIL_LIMIT, $this->model->getSharingEmailLimit()); } public function testGetSharingTextLimit() { $this->assertEquals(Config::SHARING_TEXT_LIMIT, $this->model->getSharingTextLimit()); } }