File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 3
3
namespace Elastica \Test ;
4
4
5
5
use Elastica \Client ;
6
+ use Elastica \Connection ;
6
7
use Elastica \Index ;
7
8
8
9
class Base extends \PHPUnit_Framework_TestCase
@@ -16,7 +17,7 @@ protected function _getClient(array $params = array(), $callback = null)
16
17
{
17
18
$ config = array (
18
19
'host ' => $ this ->_getHost (),
19
- 'port ' => getenv ( ' ES_PORT ' ) ?: 9200 ,
20
+ 'port ' => $ this -> _getPort () ,
20
21
);
21
22
22
23
$ config = array_merge ($ config , $ params );
@@ -25,11 +26,19 @@ protected function _getClient(array $params = array(), $callback = null)
25
26
}
26
27
27
28
/**
28
- * @return string Returns es host for tests
29
+ * @return string Host to es for elastica tests
29
30
*/
30
31
protected function _getHost ()
31
32
{
32
- return getenv ('ES_HOST ' ) ?: 'localhost ' ;
33
+ return getenv ('ES_HOST ' ) ?: Connection::DEFAULT_HOST ;
34
+ }
35
+
36
+ /**
37
+ * @return int Port to es for elastica tests
38
+ */
39
+ protected function _getPort ()
40
+ {
41
+ return getenv ('ES_PORT ' ) ?: Connection::DEFAULT_PORT ;
33
42
}
34
43
35
44
/**
You can’t perform that action at this time.
0 commit comments