Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 96a06d5

Browse files
MAGETWO-75935: Search results is not the same for the same search queries
1 parent b0edcd3 commit 96a06d5

File tree

1 file changed

+11
-3
lines changed
  • dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext

1 file changed

+11
-3
lines changed

dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testSearchResultsAreTheSameForSameRequests()
4141

4242
$objManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
4343

44-
foreach (range(1, $howManySearchRequests) as $_) {
44+
foreach (range(1, $howManySearchRequests) as $i) {
4545
/** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $fulltextCollection */
4646
$fulltextCollection = $objManager->create(
4747
\Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection::class,
@@ -52,10 +52,18 @@ public function testSearchResultsAreTheSameForSameRequests()
5252
$fulltextCollection->setOrder('relevance');
5353
$fulltextCollection->load();
5454
$items = $fulltextCollection->getItems();
55-
$this->assertGreaterThan(0, count($items), "Search result must not be empty");
55+
$this->assertGreaterThan(
56+
0,
57+
count($items),
58+
sprintf("Search #%s result must not be empty", $i)
59+
);
5660

5761
if ($previousResult) {
58-
$this->assertEquals($previousResult, array_keys($items), "Search result must be the same for the same requests");
62+
$this->assertEquals(
63+
$previousResult,
64+
array_keys($items),
65+
"Search result must be the same for the same requests"
66+
);
5967
}
6068

6169
$previousResult = array_keys($items);

0 commit comments

Comments
 (0)