Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Protected Member Functions | |
getRequestConfigPath () | |
createAdapter () | |
![]() | |
getRequestConfigPath () | |
assertPreConditions () | |
createAdapter () | |
Protected Attributes | |
$searchEngine = Config::ENGINE_NAME | |
![]() | |
$objectManager | |
$searchEngine = EngineResolver::CATALOG_SEARCH_MYSQL_ENGINE | |
Class AdapterTest
@magentoDbIsolation disabled @magentoDataFixture Magento/Framework/Search/_files/products.php
Important: Please make sure that each integration test file works with unique elastic search index. In order to achieve this, use @ magentoConfigFixture to pass unique value for 'elasticsearch_index_prefix' for every test method. E.g. '@ magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest'
In ElasticSearch, a reindex is required if the test includes a new data fixture with new items to search, see testAdvancedSearchDateField().
Definition at line 24 of file AdapterTest.php.
|
protected |
Definition at line 44 of file AdapterTest.php.
elasticSearchAdvancedSearchDataProvider | ( | ) |
Elastic Search specific data provider for advanced search test.
The expected array is for Elastic Search is different that the one for MySQL because sometimes more matches are returned. For instance, 3rd index below will return 3 matches instead of 1 (which is what MySQL returns).
Definition at line 246 of file AdapterTest.php.
|
protected |
testAdvancedSearchCompositeProductWithDisabledChild | ( | ) |
@magentoDataFixture Magento/Framework/Search/_files/product_configurable_with_disabled_child.php @magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
@magentoDataFixture Magento/Framework/Search/_files/product_configurable_with_disabled_child.php @magentoConfigFixture default/catalog/search/engine mysql
Definition at line 326 of file AdapterTest.php.
testAdvancedSearchCompositeProductWithOutOfStockOption | ( | ) |
@magentoDataFixture Magento/Framework/Search/_files/product_configurable.php @magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
@magentoDataFixture Magento/Framework/Search/_files/product_configurable.php @magentoConfigFixture default/catalog/search/engine mysql
Definition at line 315 of file AdapterTest.php.
testAdvancedSearchDateField | ( | $rangeFilter, | |
$expectedRecordsCount | |||
) |
Advanced search request using date product attribute
$rangeFilter | |
$expectedRecordsCount | @magentoDataFixture Magento/Framework/Search/_files/date_attribute.php @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest @magentoAppIsolation enabled @dataProvider dateDataProvider |
Definition at line 302 of file AdapterTest.php.
testAggregationsQuery | ( | ) |
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 76 of file AdapterTest.php.
testBoolFilter | ( | ) |
Bool filter test
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 182 of file AdapterTest.php.
testBoolFilterWithNestedNegativeBoolFilter | ( | ) |
Test bool filter with nested negative bool filter
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 194 of file AdapterTest.php.
testBoolFilterWithNestedRangeInNegativeBoolFilter | ( | ) |
Test range inside nested negative bool filter
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 206 of file AdapterTest.php.
testCustomFilterableAttribute | ( | ) |
@magentoAppIsolation enabled @magentoDataFixture Magento/Framework/Search/_files/filterable_attribute.php @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
@magentoDataFixture Magento/Framework/Search/_files/filterable_attribute.php @magentoConfigFixture default/catalog/search/engine mysql
Definition at line 265 of file AdapterTest.php.
testFilterByAttributeValues | ( | $requestName, | |
$additionalData | |||
) |
Test filtering by two attributes.
@magentoAppIsolation enabled @magentoDataFixture Magento/Framework/Search/_files/filterable_attributes.php @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest @dataProvider filterByAttributeValuesDataProvider
string | $requestName | |
array | $additionalData |
Test filtering by two attributes.
@magentoDataFixture Magento/Framework/Search/_files/filterable_attributes.php @magentoConfigFixture default/catalog/search/engine mysql @dataProvider filterByAttributeValuesDataProvider
string | $requestName | |
array | $additionalData |
Definition at line 284 of file AdapterTest.php.
testMatchOrderedQuery | ( | ) |
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 64 of file AdapterTest.php.
testMatchQuery | ( | ) |
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 54 of file AdapterTest.php.
testMatchQueryFilters | ( | ) |
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 86 of file AdapterTest.php.
testRangeFilterWithAllFields | ( | ) |
Range filter test with all fields filled
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 98 of file AdapterTest.php.
testRangeFilterWithoutFromField | ( | ) |
Range filter test with all fields filled
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 110 of file AdapterTest.php.
testRangeFilterWithoutToField | ( | ) |
Range filter test with all fields filled
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 122 of file AdapterTest.php.
testSearchLimit | ( | ) |
Request limits test
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 170 of file AdapterTest.php.
testSearchQueryBoost | ( | ) |
@magentoDataFixture Magento/Framework/Search/_files/search_weight_products.php @magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Test for search weight customization to ensure that search weight works correctly, and affects search results.
@magentoDataFixture Magento/Framework/Search/_files/search_weight_products.php @magentoConfigFixture default/catalog/search/engine mysql
Definition at line 339 of file AdapterTest.php.
testSimpleAdvancedSearch | ( | $nameQuery, | |
$descriptionQuery, | |||
$rangeFilter, | |||
$expectedRecordsCount | |||
) |
Sample Advanced search request test
@dataProvider elasticSearchAdvancedSearchDataProvider @magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
string | $nameQuery | |
string | $descriptionQuery | |
array | $rangeFilter | |
int | $expectedRecordsCount |
Definition at line 223 of file AdapterTest.php.
testTermFilter | ( | ) |
Term filter test
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 134 of file AdapterTest.php.
testTermFilterArray | ( | ) |
Term filter test
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 146 of file AdapterTest.php.
testWildcardFilter | ( | ) |
Term filter test
@magentoAppIsolation enabled @magentoConfigFixture default/catalog/search/engine elasticsearch @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
Definition at line 158 of file AdapterTest.php.
|
protected |
Definition at line 29 of file AdapterTest.php.