bugfix: trustedproxy is not a delimited pcre
[dokuwiki.git] / _test / tests / inc / httpclient_http_proxy.test.php
blobea7c0d187409e1c3177bc4f954f01623d63350fe
1 <?php
3 require_once(__DIR__ . '/httpclient_mock.php');
5 class httpclient_http_proxy_test extends DokuWikiTest
7 protected $url = 'http://httpbingo.org/user-agent';
8 protected $host;
9 protected $port;
12 public function setUp(): void
14 parent::setUp();
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");
29 /**
30 * @group internet
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');