From edf946dfc7c8ddc5f4ad125d2a0c780bbc63e769 Mon Sep 17 00:00:00 2001 From: Scott Shambarger Date: Fri, 2 Aug 2019 15:18:01 -0700 Subject: Correctly handle emtpy string in proxyuserpwd config As documented, the default value for config value proxyuserpwd is ''. However, that value results in the error: "cURL error 5: Unsupported proxy syntax in '@'". This patch handles the values of '' and null (the default in the code) the same for config values proxyuserpwd and proxy. Signed-off-by: Scott Shambarger --- tests/lib/Http/Client/ClientTest.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php index f43958ab865..7a25acd9a50 100644 --- a/tests/lib/Http/Client/ClientTest.php +++ b/tests/lib/Http/Client/ClientTest.php @@ -70,12 +70,22 @@ class ClientTest extends \Test\TestCase { $this->config ->expects($this->at(0)) ->method('getSystemValue') - ->with('proxy', null) + ->with( + $this->equalTo('proxy'), + $this->callback(function ($input) { + return $input === ''; + }) + ) ->willReturn('foo'); $this->config ->expects($this->at(1)) ->method('getSystemValue') - ->with('proxyuserpwd', null) + ->with( + $this->equalTo('proxyuserpwd'), + $this->callback(function ($input) { + return $input === ''; + }) + ) ->willReturn('username:password'); $this->assertSame('username:password@foo', self::invokePrivate($this->client, 'getProxyUri')); } -- cgit v1.2.3