diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-02-11 23:01:29 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-02-11 23:02:44 +0100 |
commit | 2bbe40cf8802bbc3bbf83d454cc294080ebaf241 (patch) | |
tree | 6e2b825a13b733c6496bdefbb130385dd900ae9f /_test/tests | |
parent | 44e51f2fde494e6183b60153246c72bacef88ad7 (diff) | |
download | rpg-2bbe40cf8802bbc3bbf83d454cc294080ebaf241.tar.gz rpg-2bbe40cf8802bbc3bbf83d454cc294080ebaf241.tar.bz2 |
HTTPClient: correctly abort a proxy connection
if a needed CONNECT tunnel fails
Diffstat (limited to '_test/tests')
-rw-r--r-- | _test/tests/inc/httpclient_http_proxy.test.php | 1 | ||||
-rw-r--r-- | _test/tests/inc/httpclient_https_proxy.test.php | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/_test/tests/inc/httpclient_http_proxy.test.php b/_test/tests/inc/httpclient_http_proxy.test.php index 61228ad94..c44dc7ed7 100644 --- a/_test/tests/inc/httpclient_http_proxy.test.php +++ b/_test/tests/inc/httpclient_http_proxy.test.php @@ -18,5 +18,4 @@ class httpclient_http_proxy_test extends DokuWikiTest { $this->assertFalse($data === false, 'HTTP response '.$http->error); $this->assertTrue(strpos($data,'DokuWiki') !== false, 'response content'); } - }
\ No newline at end of file diff --git a/_test/tests/inc/httpclient_https_proxy.test.php b/_test/tests/inc/httpclient_https_proxy.test.php index aca3b3be2..9402e91af 100644 --- a/_test/tests/inc/httpclient_https_proxy.test.php +++ b/_test/tests/inc/httpclient_https_proxy.test.php @@ -12,4 +12,19 @@ class httpclient_https_proxy_test extends httpclient_http_proxy_test { } parent::setUp(); } + + /** + * @group internet + */ + function test_connectfail(){ + $http = new HTTPMockClient(); + // proxy provided by Andrwe Lord Weber <dokuwiki@andrwe.org> + $http->proxy_host = 'proxy.andrwe.org'; + $http->proxy_port = 8080; + + // the proxy accepts connections to dokuwiki.org only - the connect call should fail + $data = $http->get('https://www.google.com'); + $this->assertFalse($data); + $this->assertEquals(-150, $http->status); + } }
\ No newline at end of file |