Skip to content

Commit fa4844d

Browse files
committed
MC-18009: Disabled Products Do Not Appear in Search Results of Link Attribute
- update tests
1 parent 04a9f10 commit fa4844d

File tree

2 files changed

+18
-2
lines changed
  • dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product

2 files changed

+18
-2
lines changed

app/code/Magento/Catalog/Model/ProductLink/Search.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
use Magento\Catalog\Api\Data\ProductInterface;
1212

13-
/** Returns collection of product visible in catalog by search key */
13+
/**
14+
* Returns collection of product visible in catalog by search key
15+
*/
1416
class Search
1517
{
1618
/**

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SearchTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ public function testExecuteNotVisibleIndividuallyProducts() : void
5757
->setPostValue('limit', 50);
5858
$this->dispatch('backend/catalog/product/search');
5959
$responseBody = $this->getResponse()->getBody();
60-
$this->assertContains('{"options":[],"total":0}', $responseBody);
60+
$this->assertContains('"total":1}', $responseBody);
61+
}
62+
63+
/**
64+
* @magentoDataFixture Magento/Catalog/_files/multiple_mixed_products.php
65+
*/
66+
public function testExecuteEnabledAndDisabledProducts() : void
67+
{
68+
$this->getRequest()
69+
->setPostValue('searchKey', 'simple')
70+
->setPostValue('page', 1)
71+
->setPostValue('limit', 50);
72+
$this->dispatch('backend/catalog/product/search');
73+
$responseBody = $this->getResponse()->getBody();
74+
$this->assertContains('"total":3}', $responseBody);
6175
}
6276
}

0 commit comments

Comments
 (0)