@@ -84,7 +84,7 @@ public function testWithEnvironmentalProxy()
84
84
{
85
85
putenv ('http_proxy= ' . $ this ->_getProxyUrl () . '/ ' );
86
86
87
- $ client = new \ Elastica \ Client (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
87
+ $ client = $ this -> _getClient (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
88
88
$ transferInfo = $ client ->request ('/_nodes ' )->getTransferInfo ();
89
89
$ this ->assertEquals (200 , $ transferInfo ['http_code ' ]);
90
90
@@ -99,11 +99,11 @@ public function testWithEnabledEnvironmentalProxy()
99
99
{
100
100
putenv ('http_proxy= ' . $ this ->_getProxyUrl () . '/ ' );
101
101
102
- $ client = new \ Elastica \ Client (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
102
+ $ client = $ this -> _getClient (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
103
103
$ transferInfo = $ client ->request ('/_nodes ' )->getTransferInfo ();
104
104
$ this ->assertEquals (403 , $ transferInfo ['http_code ' ]);
105
105
106
- $ client = new \ Elastica \ Client (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
106
+ $ client = $ this -> _getClient (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
107
107
$ client ->getConnection ()->setProxy ('' );
108
108
$ transferInfo = $ client ->request ('/_nodes ' )->getTransferInfo ();
109
109
$ this ->assertEquals (200 , $ transferInfo ['http_code ' ]);
@@ -113,7 +113,7 @@ public function testWithEnabledEnvironmentalProxy()
113
113
114
114
public function testWithProxy ()
115
115
{
116
- $ client = new \ Elastica \ Client (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
116
+ $ client = $ this -> _getClient (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
117
117
$ client ->getConnection ()->setProxy ($ this ->_getProxyUrl ());
118
118
119
119
$ transferInfo = $ client ->request ('/_nodes ' )->getTransferInfo ();
@@ -122,7 +122,7 @@ public function testWithProxy()
122
122
123
123
public function testWithoutProxy ()
124
124
{
125
- $ client = new \ Elastica \ Client (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
125
+ $ client = $ this -> _getClient (array ('transport ' => 'Guzzle ' , 'persistent ' => false ));
126
126
$ client ->getConnection ()->setProxy ('' );
127
127
128
128
$ transferInfo = $ client ->request ('/_nodes ' )->getTransferInfo ();
0 commit comments