Skip to content

Commit 628d1d7

Browse files
committed
Replace additional Elastica\Client through _getClient()
1 parent ffe24b1 commit 628d1d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/lib/Elastica/Test/Transport/GuzzleTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function testWithEnvironmentalProxy()
8484
{
8585
putenv('http_proxy=' . $this->_getProxyUrl() . '/');
8686

87-
$client = new \Elastica\Client(array('transport' => 'Guzzle', 'persistent' => false));
87+
$client = $this->_getClient(array('transport' => 'Guzzle', 'persistent' => false));
8888
$transferInfo = $client->request('/_nodes')->getTransferInfo();
8989
$this->assertEquals(200, $transferInfo['http_code']);
9090

@@ -99,11 +99,11 @@ public function testWithEnabledEnvironmentalProxy()
9999
{
100100
putenv('http_proxy=' . $this->_getProxyUrl() . '/');
101101

102-
$client = new \Elastica\Client(array('transport' => 'Guzzle', 'persistent' => false));
102+
$client = $this->_getClient(array('transport' => 'Guzzle', 'persistent' => false));
103103
$transferInfo = $client->request('/_nodes')->getTransferInfo();
104104
$this->assertEquals(403, $transferInfo['http_code']);
105105

106-
$client = new \Elastica\Client(array('transport' => 'Guzzle', 'persistent' => false));
106+
$client = $this->_getClient(array('transport' => 'Guzzle', 'persistent' => false));
107107
$client->getConnection()->setProxy('');
108108
$transferInfo = $client->request('/_nodes')->getTransferInfo();
109109
$this->assertEquals(200, $transferInfo['http_code']);
@@ -113,7 +113,7 @@ public function testWithEnabledEnvironmentalProxy()
113113

114114
public function testWithProxy()
115115
{
116-
$client = new \Elastica\Client(array('transport' => 'Guzzle', 'persistent' => false));
116+
$client = $this->_getClient(array('transport' => 'Guzzle', 'persistent' => false));
117117
$client->getConnection()->setProxy($this->_getProxyUrl());
118118

119119
$transferInfo = $client->request('/_nodes')->getTransferInfo();
@@ -122,7 +122,7 @@ public function testWithProxy()
122122

123123
public function testWithoutProxy()
124124
{
125-
$client = new \Elastica\Client(array('transport' => 'Guzzle', 'persistent' => false));
125+
$client = $this->_getClient(array('transport' => 'Guzzle', 'persistent' => false));
126126
$client->getConnection()->setProxy('');
127127

128128
$transferInfo = $client->request('/_nodes')->getTransferInfo();

0 commit comments

Comments
 (0)