xref: /dokuwiki/_test/tests/inc/httpclient_http_proxy.test.php (revision b7cfeab63d3666a24fad96ae42669a2f55e9da03)
11ea7a6baSAndreas Gohr<?php
21ea7a6baSAndreas Gohr
31ea7a6baSAndreas Gohrclass httpclient_http_proxy_test extends DokuWikiTest {
4*b7cfeab6SAndreas Gohr    protected $url = 'http://test.dokuwiki.org/README';
51ea7a6baSAndreas Gohr
61ea7a6baSAndreas Gohr    /**
71ea7a6baSAndreas Gohr     * @group internet
81ea7a6baSAndreas Gohr     */
91ea7a6baSAndreas Gohr    function test_simpleget(){
101ea7a6baSAndreas Gohr        $http = new HTTPClient();
11a20ce704SAndreas Gohr        // proxy provided by  Andrwe Lord Weber <dokuwiki@andrwe.org>
12a20ce704SAndreas Gohr        $http->proxy_host = 'proxy.andrwe.org';
13a20ce704SAndreas Gohr        $http->proxy_port = 8080;
141ea7a6baSAndreas Gohr
151ea7a6baSAndreas Gohr        $data = $http->get($this->url);
16712c6631SAndreas Gohr        $this->assertFalse($data === false, 'HTTP response '.$http->error);
171ea7a6baSAndreas Gohr        $this->assertTrue(strpos($data,'DokuWiki') !== false, 'response content');
181ea7a6baSAndreas Gohr    }
191ea7a6baSAndreas Gohr
201ea7a6baSAndreas Gohr}