aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_test/tests/inc/httpclient_http.test.php
diff options
context:
space:
mode:
Diffstat (limited to '_test/tests/inc/httpclient_http.test.php')
-rw-r--r--_test/tests/inc/httpclient_http.test.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/_test/tests/inc/httpclient_http.test.php b/_test/tests/inc/httpclient_http.test.php
index 6cc783b2b..f3afdce66 100644
--- a/_test/tests/inc/httpclient_http.test.php
+++ b/_test/tests/inc/httpclient_http.test.php
@@ -276,13 +276,13 @@ class httpclient_http_test extends DokuWikiTest {
*/
function test_chunked(){
$http = new HTTPMockClient();
- $data = $http->get('http://whoopdedo.org/cgi-bin/chunked/2550');
+ $data = $http->get($this->server.'/stream-bytes/5000?chunk_size=250');
if($http->noconnection()) {
$this->markTestSkipped('connection timed out');
return;
}
$this->assertFalse($data === false, $http->errorInfo());
- $this->assertEquals(2550,strlen($data));
+ $this->assertEquals(5000,strlen($data));
}
/**
@@ -301,6 +301,9 @@ class httpclient_http_test extends DokuWikiTest {
$this->assertTrue($data !== false, $http->errorInfo());
}
+ /**
+ * @throws ReflectionException
+ */
function test_postencode(){
$http = new HTTPMockClient();
@@ -312,7 +315,7 @@ class httpclient_http_test extends DokuWikiTest {
);
$this->assertEquals(
'%C3%B6%C3%A4%3F=%C3%B6%C3%A4%3F&foo=bang',
- $http->_postEncode($data),
+ $this->callInaccessibleMethod($http, 'postEncode', [$data]),
'simple'
);
@@ -323,7 +326,7 @@ class httpclient_http_test extends DokuWikiTest {
);
$this->assertEquals(
'foo=bang&%C3%A4rr%5B0%5D=%C3%B6&%C3%A4rr%5B1%5D=b&%C3%A4rr%5B2%5D=c',
- $http->_postEncode($data),
+ $this->callInaccessibleMethod($http, 'postEncode', [$data]),
'onelevelnum'
);
@@ -334,7 +337,7 @@ class httpclient_http_test extends DokuWikiTest {
);
$this->assertEquals(
'foo=bang&%C3%A4rr%5B%C3%B6%5D=%C3%A4&%C3%A4rr%5Bb%5D=c',
- $http->_postEncode($data),
+ $this->callInaccessibleMethod($http, 'postEncode', [$data]),
'onelevelassoc'
);
@@ -346,7 +349,7 @@ class httpclient_http_test extends DokuWikiTest {
);
$this->assertEquals(
'foo=bang&%C3%A4rr%5B%C3%B6%5D=%C3%A4&%C3%A4rr%5B%C3%A4%5D%5B%C3%B6%5D=%C3%A4',
- $http->_postEncode($data),
+ $this->callInaccessibleMethod($http, 'postEncode', [$data]),
'twolevelassoc'
);
}