- Timestamp:
- 01/14/2025 03:35:18 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesFile.php
r59061 r59604 44 44 45 45 $error = download_url( 'test_download_url_non_200' ); 46 46 47 $this->assertWPError( $error ); 47 48 $this->assertSame( … … 56 57 57 58 $error = download_url( 'test_download_url_non_200' ); 59 60 remove_filter( 'download_url_error_max_body_size', array( $this, '__return_5' ) ); 61 remove_filter( 'pre_http_request', array( $this, '_fake_download_url_non_200_response_code' ) ); 62 58 63 $this->assertWPError( $error ); 59 64 $this->assertSame( … … 64 69 $error->get_error_data() 65 70 ); 66 67 remove_filter( 'download_url_error_max_body_size', array( $this, '__return_5' ) );68 remove_filter( 'pre_http_request', array( $this, '_fake_download_url_non_200_response_code' ) );69 71 } 70 72 … … 95 97 96 98 $filename = download_url( 'url_with_content_disposition_header' ); 97 $this->assertStringContainsString( 'filename-from-content-disposition-header', $filename ); 99 100 remove_filter( 'pre_http_request', array( $this, $filter ) ); 101 98 102 $this->assertFileExists( $filename ); 99 103 $this->unlink( $filename ); 100 104 101 remove_filter( 'pre_http_request', array( $this, $filter ));105 $this->assertStringContainsString( 'filename-from-content-disposition-header', $filename ); 102 106 } 103 107 … … 127 131 128 132 $filename = download_url( 'url_with_content_disposition_header' ); 133 134 remove_filter( 'pre_http_request', array( $this, $filter ) ); 135 136 $this->unlink( $filename ); 137 129 138 $this->assertStringContainsString( get_temp_dir(), $filename ); 130 $this->unlink( $filename );131 132 remove_filter( 'pre_http_request', array( $this, $filter ) );133 139 } 134 140 … … 210 216 211 217 $filename = download_url( 'url_with_content_disposition_header' ); 218 219 remove_filter( 'pre_http_request', array( $this, $filter ) ); 220 221 $this->unlink( $filename ); 222 212 223 $this->assertStringContainsString( 'url_with_content_disposition_header', $filename ); 213 $this->unlink( $filename );214 215 remove_filter( 'pre_http_request', array( $this, $filter ) );216 224 } 217 225
Note: See TracChangeset
for help on using the changeset viewer.