public function testGetIdentities() { $productTags = array('catalog_product_1'); $product = $this->getMock('Magento\\Catalog\\Model\\Product', [], [], '', false); $product->expects($this->once())->method('getIdentities')->will($this->returnValue($productTags)); $this->registryMock->expects($this->once())->method('registry')->with('current_product')->will($this->returnValue($product)); $this->assertEquals($productTags, $this->block->getIdentities()); }
public function testGetIdentities() { $productTags = ['catalog_product_1']; $product = $this->getMock('Magento\\Catalog\\Model\\Product', [], [], '', false); $product->expects($this->once())->method('getIdentities')->will($this->returnValue($productTags)); $store = $this->getMock('Magento\\Store\\Model\\Store', ['getWebsiteId', '__wakeup'], [], '', false); $store->expects($this->any())->method('getWebsiteId')->willReturn(0); $product->expects($this->any())->method('getStore')->will($this->returnValue($store)); $this->registryMock->expects($this->once())->method('registry')->with('current_product')->will($this->returnValue($product)); $this->assertEquals($productTags, $this->block->getIdentities()); }