File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
dev/tests/integration/_files/Magento/TestModuleCatalogSearch/Model Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 77
88namespace Magento \TestModuleCatalogSearch \Model ;
99
10+ use Magento \Framework \App \Config \ScopeConfigInterface ;
11+ use Magento \TestFramework \Helper \Bootstrap ;
1012use Magento \TestFramework \Helper \Curl ;
1113
1214/**
1315 * Retrieve search engine version by curl request
1416 */
1517class SearchEngineVersionReader
1618{
19+ private const SEARCH_ENGINE_PATH = 'catalog/search/engine ' ;
20+
1721 /**
1822 * @var array
1923 */
@@ -62,7 +66,17 @@ private function getInfo(): array
6266 {
6367 if (!$ this ->versionInfo ) {
6468 $ curl = new Curl ();
65- $ url = 'http://localhost:9200 ' ;
69+
70+ $ scopeConfig = Bootstrap::getObjectManager ()->get (ScopeConfigInterface::class);
71+ if ($ scopeConfig ->getValue (self ::SEARCH_ENGINE_PATH )) {
72+ $ engine = $ scopeConfig ->getValue (self ::SEARCH_ENGINE_PATH );
73+ $ serverHost = $ scopeConfig ->getValue ("catalog/search/ {$ engine }_server_hostname " );
74+ $ port = $ scopeConfig ->getValue ("catalog/search/ {$ engine }_server_port " );
75+ $ url = $ serverHost . ': ' . $ port ;
76+ } else {
77+ $ url = 'http://localhost:9200 ' ;
78+ }
79+
6680 $ curl ->get ($ url );
6781 $ curl ->addHeader ('content-type ' , 'application/json ' );
6882 $ data = $ curl ->getBody ();
You can’t perform that action at this time.
0 commit comments