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 7
7
8
8
namespace Magento \TestModuleCatalogSearch \Model ;
9
9
10
+ use Magento \Framework \App \Config \ScopeConfigInterface ;
11
+ use Magento \TestFramework \Helper \Bootstrap ;
10
12
use Magento \TestFramework \Helper \Curl ;
11
13
12
14
/**
13
15
* Retrieve search engine version by curl request
14
16
*/
15
17
class SearchEngineVersionReader
16
18
{
19
+ private const SEARCH_ENGINE_PATH = 'catalog/search/engine ' ;
20
+
17
21
/**
18
22
* @var array
19
23
*/
@@ -62,7 +66,17 @@ private function getInfo(): array
62
66
{
63
67
if (!$ this ->versionInfo ) {
64
68
$ 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
+
66
80
$ curl ->get ($ url );
67
81
$ curl ->addHeader ('content-type ' , 'application/json ' );
68
82
$ data = $ curl ->getBody ();
You can’t perform that action at this time.
0 commit comments