/** * @covers \Magento\Catalog\Model\Product::getUpSellProducts * @covers \Magento\Catalog\Model\Product::getUpSellProductIds * @covers \Magento\Catalog\Model\Product::getUpSellProductCollection * @covers \Magento\Catalog\Model\Product::getUpSellLinkCollection */ public function testUpSellProductsApi() { $this->assertEquals([], $this->_model->getUpSellProducts()); $this->assertEquals([], $this->_model->getUpSellProductIds()); $collection = $this->_model->getUpSellProductCollection(); $this->assertInstanceOf('Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection', $collection); $this->assertSame($this->_model, $collection->getProduct()); $linkCollection = $this->_model->getUpSellLinkCollection(); $this->assertInstanceOf('Magento\\Catalog\\Model\\ResourceModel\\Product\\Link\\Collection', $linkCollection); $this->assertSame($this->_model, $linkCollection->getProduct()); }
/** * {@inheritdoc} */ public function getUpSellProductIds() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getUpSellProductIds'); if (!$pluginInfo) { return parent::getUpSellProductIds(); } else { return $this->___callPlugins('getUpSellProductIds', func_get_args(), $pluginInfo); } }