diff options
author | Guy Brand <gb@unistra.fr> | 2020-06-01 12:54:55 +0200 |
---|---|---|
committer | Guy Brand <gb@unistra.fr> | 2020-06-01 12:54:55 +0200 |
commit | deeaa689327c15fc7e9395ba329a6f2513c654ec (patch) | |
tree | c783eea9ed5410eeece153e397a465046856f7d6 /_test/tests/inc/httpclient_http.test.php | |
parent | 504b44a4c7fde212be653fc640f1685318449287 (diff) | |
parent | bf713fe248da134f13395558651321459abc717e (diff) | |
download | dokuwiki-deeaa689327c15fc7e9395ba329a6f2513c654ec.tar.gz dokuwiki-deeaa689327c15fc7e9395ba329a6f2513c654ec.zip |
Merge master into stable
Diffstat (limited to '_test/tests/inc/httpclient_http.test.php')
-rw-r--r-- | _test/tests/inc/httpclient_http.test.php | 15 |
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' ); } |