/** * @magentoDataFixture Magento/Catalog/_files/products_crosssell.php */ public function testAddLinkAttributeToFilterNoResults() { $om = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $link = $om->get('\\Magento\\Catalog\\Model\\Product\\Link')->useCrossSellLinks(); $this->collection->setLinkModel($link); $this->collection->addLinkAttributeToFilter('position', array('from' => 2, 'to' => 3)); $product = $om->get('Magento\\Catalog\\Model\\Product')->load(2); $this->collection->setProduct($product); $this->collection->load(); $this->assertCount(0, $this->collection->getItems()); }