/** * @group internet */ function test_simpleget() { $http = new HTTPMockClient(); // proxy provided by Andrwe Lord Weber <*****@*****.**> $http->proxy_host = 'proxy.andrwe.org'; $http->proxy_port = 8080; $data = $http->get($this->url); $this->assertFalse($data === false, 'HTTP response: ' . $http->error . ' [' . $this->url . ']'); $this->assertTrue(strpos($data, 'DokuWiki') !== false, 'response content'); }
/** * @group internet */ function test_connectfail() { $http = new HTTPMockClient(); // proxy provided by Andrwe Lord Weber <*****@*****.**> $http->proxy_host = 'proxy.andrwe.org'; $http->proxy_port = 8080; // the proxy accepts connections to dokuwiki.org only - the connect call should fail $data = $http->get('https://www.google.com'); $this->assertFalse($data); $this->assertEquals(-150, $http->status); }
/** * This address caused trouble with stream_select() * * @group internet * @group flaky */ function test_wikimatrix() { $http = new HTTPMockClient(); $data = $http->get('http://www.wikimatrix.org/cfeed/dokuwiki/-/-'); if ($http->noconnection()) { $this->markTestSkipped('connection timed out'); return; } $this->assertTrue($data !== false, 'HTTP response ' . $http->error); }