Skip to content

Commit 6781b57

Browse files
committed
MAGE-1050: category search test included.
1 parent e6b8d0c commit 6781b57

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

Test/Integration/Search/SearchTest.php

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,34 @@
88

99
class SearchTest extends TestCase
1010
{
11-
public function testSearch()
11+
/** @var Product */
12+
protected $productIndexer;
13+
14+
/** @var Data */
15+
protected $helper;
16+
17+
public function setUp(): void
1218
{
13-
/** @var Product $indexer */
14-
$indexer = $this->getObjectManager()->create(Product::class);
15-
$indexer->executeFull();
19+
parent::setUp();
1620

21+
$this->productIndexer = $this->objectManager->get(Product::class);
22+
$this->helper = $this->getObjectManager()->create(Data::class);
23+
24+
$this->productIndexer->executeFull();
1725
$this->algoliaHelper->waitLastTask();
26+
}
1827

19-
/** @var Data $helper */
20-
$helper = $this->getObjectManager()->create(Data::class);
21-
list($results, $totalHits, $facetsFromAlgolia) = $helper->getSearchResult('', 1);
28+
public function testSearch()
29+
{
30+
list($results, $totalHits, $facetsFromAlgolia) = $this->helper->getSearchResult('', 1);
31+
$this->assertNotEmpty($results);
32+
}
2233

34+
public function testCategorySearch()
35+
{
36+
list($results, $totalHits, $facetsFromAlgolia) = $this->helper->getSearchResult('', 1, [
37+
'facetFilters' => ['categoryIds:' . $this->assertValues->expectedCategory]
38+
]);
2339
$this->assertNotEmpty($results);
2440
}
2541
}

0 commit comments

Comments
 (0)