@@ -49,40 +49,45 @@ public function testGetProxyUri() {
4949 $ this ->config
5050 ->expects ($ this ->at (0 ))
5151 ->method ('getSystemValue ' )
52- ->with ('proxy ' , null )
53- ->willReturn (null );
54- $ this ->config
55- ->expects ($ this ->at (1 ))
56- ->method ('getSystemValue ' )
57- ->with ('proxyuserpwd ' , null )
58- ->willReturn (null );
59- $ this ->assertSame ('' , self ::invokePrivate ($ this ->client , 'getProxyUri ' ));
52+ ->with ('proxy ' , '' )
53+ ->willReturn ('' );
54+ $ this ->assertNull (self ::invokePrivate ($ this ->client , 'getProxyUri ' ));
6055 }
6156
6257 public function testGetProxyUriProxyHostEmptyPassword () {
6358 $ this ->config
6459 ->expects ($ this ->at (0 ))
6560 ->method ('getSystemValue ' )
66- ->with ('proxy ' , null )
61+ ->with ('proxy ' , '' )
6762 ->willReturn ('foo ' );
6863 $ this ->config
6964 ->expects ($ this ->at (1 ))
7065 ->method ('getSystemValue ' )
71- ->with ('proxyuserpwd ' , null )
72- ->willReturn (null );
66+ ->with ('proxyuserpwd ' , '' )
67+ ->willReturn ('' );
7368 $ this ->assertSame ('foo ' , self ::invokePrivate ($ this ->client , 'getProxyUri ' ));
7469 }
7570
7671 public function testGetProxyUriProxyHostWithPassword () {
7772 $ this ->config
7873 ->expects ($ this ->at (0 ))
7974 ->method ('getSystemValue ' )
80- ->with ('proxy ' , null )
75+ ->with (
76+ $ this ->equalTo ('proxy ' ),
77+ $ this ->callback (function ($ input ) {
78+ return $ input === '' ;
79+ })
80+ )
8181 ->willReturn ('foo ' );
8282 $ this ->config
8383 ->expects ($ this ->at (1 ))
8484 ->method ('getSystemValue ' )
85- ->with ('proxyuserpwd ' , null )
85+ ->with (
86+ $ this ->equalTo ('proxyuserpwd ' ),
87+ $ this ->callback (function ($ input ) {
88+ return $ input === '' ;
89+ })
90+ )
8691 ->willReturn ('username:password ' );
8792 $ this ->assertSame ('username:password@foo ' , self ::invokePrivate ($ this ->client , 'getProxyUri ' ));
8893 }
@@ -260,7 +265,8 @@ public function testSetDefaultOptionsWithNotInstalled() {
260265 ->willReturn ([]);
261266
262267 $ this ->assertEquals ([
263- 'verify ' => \OC ::$ SERVERROOT . '/resources/config/ca-bundle.crt '
268+ 'verify ' => \OC ::$ SERVERROOT . '/resources/config/ca-bundle.crt ' ,
269+ 'proxy ' => null ,
264270 ], self ::invokePrivate ($ this ->client , 'getRequestOptions ' ));
265271 }
266272
0 commit comments