Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorScott Shambarger <devel@shambarger.net>2019-08-03 01:18:01 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2019-08-11 22:07:30 +0300
commitedf946dfc7c8ddc5f4ad125d2a0c780bbc63e769 (patch)
treeb1adc90ab2e142a6e0fd9b7643450bef33dc9d1a /tests
parent1d72073e349bf6926a13c085495c44fce2406e61 (diff)
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 <devel@shambarger.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Http/Client/ClientTest.php14
1 files changed, 12 insertions, 2 deletions
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'));
}