mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
HTTP API: Fix an issue where the limit_response_size parameter wasn't working properly with large documents and the cURL transport.
Fixes #31172 git-svn-id: https://develop.svn.wordpress.org/trunk@31290 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -215,6 +215,22 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests Limiting the response size when returning strings
|
||||
*
|
||||
* @ticket 31172
|
||||
*/
|
||||
function test_request_limited_size() {
|
||||
// we'll test against a file in the unit test data
|
||||
$url = 'http://develop.svn.wordpress.org/trunk/tests/phpunit/data/images/2004-07-22-DSC_0007.jpg';
|
||||
$size = 10000;
|
||||
|
||||
$res = wp_remote_request( $url, array( 'timeout' => 30, 'limit_response_size' => $size ) );
|
||||
|
||||
$this->assertFalse( is_wp_error( $res ) );
|
||||
$this->assertEquals( $size, strlen( $res['body'] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test POST redirection methods
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user