3 require_once(__DIR__
. '/httpclient_mock.php');
5 class httpclient_http_proxy_test
extends DokuWikiTest
7 protected $url = 'http://httpbingo.org/user-agent';
12 public function setUp(): void
15 $configuration = DOKU_UNITTEST
. "proxy.conf.php";
16 if (file_exists($configuration)) {
17 /** @var $conf array */
18 include $configuration;
19 $this->host
= $conf['host'];
20 $this->port
= $conf['port'];
23 if (!$this->host ||
!$this->port
) {
24 $this->markTestSkipped("Skipped proxy tests. Missing configuration");
32 function testSimpleGet()
34 $http = new HTTPMockClient();
35 $http->proxy_host
= $this->host
;
36 $http->proxy_port
= $this->port
;
38 $data = $http->get($this->url
);
39 $this->assertFalse($data === false, $http->errorInfo($this->url
));
40 $this->assertStringContainsString('DokuWiki', $data, 'response content');