xref: /dokuwiki/_test/tests/inc/httpclient_http_proxy.test.php (revision f56d5034a8c2ff1de783204266e0b7c8ee9647d7)
11ea7a6baSAndreas Gohr<?php
21ea7a6baSAndreas Gohr
395e6ded1SAndreas Gohrrequire_once (__DIR__ . '/httpclient_mock.php');
495e6ded1SAndreas Gohr
51ea7a6baSAndreas Gohrclass httpclient_http_proxy_test extends DokuWikiTest {
6*f56d5034SAndreas Gohr    protected $url = 'http://eu.httpbin.org/user-agent';
71ea7a6baSAndreas Gohr
81ea7a6baSAndreas Gohr    /**
91ea7a6baSAndreas Gohr     * @group internet
101ea7a6baSAndreas Gohr     */
111ea7a6baSAndreas Gohr    function test_simpleget(){
1295e6ded1SAndreas Gohr        $http = new HTTPMockClient();
13a20ce704SAndreas Gohr        // proxy provided by  Andrwe Lord Weber <dokuwiki@andrwe.org>
14a20ce704SAndreas Gohr        $http->proxy_host = 'proxy.andrwe.org';
15a20ce704SAndreas Gohr        $http->proxy_port = 8080;
161ea7a6baSAndreas Gohr
171ea7a6baSAndreas Gohr        $data = $http->get($this->url);
1809513545SAndreas Gohr        $this->assertFalse($data === false, 'HTTP response: '.$http->error.' ['.$this->url.']');
191ea7a6baSAndreas Gohr        $this->assertTrue(strpos($data,'DokuWiki') !== false, 'response content');
201ea7a6baSAndreas Gohr    }
211ea7a6baSAndreas Gohr}
22