public function testGetIdentities() { $productTags = array('catalog_product_1'); $product = $this->getMock('Magento\\Catalog\\Model\\Product', array(), array(), '', false); $product->expects($this->once())->method('getIdentities')->will($this->returnValue($productTags)); $collection = new \ReflectionProperty('Magento\\Reports\\Block\\Product\\Viewed', '_collection'); $collection->setAccessible(true); $collection->setValue($this->block, array($product)); $this->assertEquals($productTags, $this->block->getIdentities()); }