_objectManager->get(StoreManagerInterface::class); $secondStore = $storeManager->getStore('fixturestore'); $storeManager->setCurrentStore($secondStore); try { $this->dispatch('/catalogsearch/result/?q=search+product'); $responseBody = $this->getResponse()->getBody(); } finally { $defaultStore = $storeManager->getStore('default'); $storeManager->setCurrentStore($defaultStore); } $this->assertStringContainsString('search product 1', $responseBody); } /** * Tests quick search with "Minimum Terms to Match" sets to "100%". * * @magentoAppArea frontend * @magentoDbIsolation disabled * @magentoConfigFixture current_store catalog/search/elasticsearch7_minimum_should_match 100% * @magentoConfigFixture current_store catalog/search/elasticsearch8_minimum_should_match 100% * @magentoConfigFixture current_store catalog/search/opensearch_minimum_should_match 100% * @magentoDataFixture Magento/Elasticsearch/_files/products_for_search.php * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php */ public function testQuickSearchWithMinimumTermsToMatch() { $this->dispatch('/catalogsearch/result/?q=24+MB04'); $responseBody = $this->getResponse()->getBody(); $this->assertStringContainsString('search product 2', $responseBody); $this->assertStringNotContainsString('search product 1', $responseBody); } }