Changeset 52382 for trunk/tests/phpunit/tests/admin/includesFile.php
- Timestamp:
- 12/15/2021 07:59:32 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesFile.php
r52242 r52382 292 292 */ 293 293 public function test_download_url_no_warning_for_url_without_path() { 294 // Hook a mocked HTTP request response. 295 add_filter( 'pre_http_request', array( $this, 'mock_http_request' ), 10, 3 ); 296 294 297 $result = download_url( 'https://example.com' ); 295 298 … … 307 310 */ 308 311 public function test_download_url_no_warning_for_url_without_path_with_signature_verification() { 312 // Hook a mocked HTTP request response. 313 add_filter( 'pre_http_request', array( $this, 'mock_http_request' ), 10, 3 ); 314 309 315 add_filter( 310 316 'wp_signature_hosts', … … 327 333 $this->assertSame( 'signature_verification_no_signature', $error->get_error_code() ); 328 334 } 335 336 /** 337 * Mock the HTTP request response. 338 * 339 * @param bool $false False. 340 * @param array $arguments Request arguments. 341 * @param string $url Request URL. 342 * @return array|bool 343 */ 344 public function mock_http_request( $false, $arguments, $url ) { 345 if ( 'https://example.com' === $url ) { 346 return array( 347 'response' => array( 348 'code' => 200, 349 ), 350 ); 351 } 352 353 return $false; 354 } 329 355 }
Note: See TracChangeset
for help on using the changeset viewer.