xref: /dokuwiki/_test/tests/inc/httpclient_http_proxy.test.php (revision 1ea7a6bada66fc9b7a45f61b4892e4ea23196d89)
1*1ea7a6baSAndreas Gohr<?php
2*1ea7a6baSAndreas Gohr
3*1ea7a6baSAndreas Gohrclass httpclient_http_proxy_test extends DokuWikiTest {
4*1ea7a6baSAndreas Gohr    protected $url = 'http://www.dokuwiki.org/README';
5*1ea7a6baSAndreas Gohr
6*1ea7a6baSAndreas Gohr    /**
7*1ea7a6baSAndreas Gohr     * @group internet
8*1ea7a6baSAndreas Gohr     */
9*1ea7a6baSAndreas Gohr    function test_simpleget(){
10*1ea7a6baSAndreas Gohr        $http = new HTTPClient();
11*1ea7a6baSAndreas Gohr        $http->proxy_host = 'localhost'; //FIXME we need a public server
12*1ea7a6baSAndreas Gohr        $http->proxy_port = 3128;
13*1ea7a6baSAndreas Gohr
14*1ea7a6baSAndreas Gohr        $data = $http->get($this->url);
15*1ea7a6baSAndreas Gohr        $this->assertFalse($data === false, 'HTTP response');
16*1ea7a6baSAndreas Gohr        $this->assertTrue(strpos($data,'DokuWiki') !== false, 'response content');
17*1ea7a6baSAndreas Gohr    }
18*1ea7a6baSAndreas Gohr
19*1ea7a6baSAndreas Gohr}