Changeset 50472 for branches/5.7/tests/phpunit/tests/https-detection.php
- Timestamp:
- 03/02/2021 03:14:09 PM (4 years ago)
- Location:
- branches/5.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.7
-
branches/5.7/tests/phpunit/tests/https-detection.php
r50391 r50472 57 57 /** 58 58 * @ticket 47577 59 * @ticket 52484 59 60 */ 60 61 public function test_wp_update_https_detection_errors() { … … 69 70 70 71 // If initial request fails and request without SSL verification succeeds, 71 // return error with 'ssl_verification_failed' error code.72 // return 'ssl_verification_failed' error. 72 73 add_filter( 'pre_http_request', array( $this, 'mock_error_with_sslverify' ), 10, 2 ); 73 74 add_filter( 'pre_http_request', array( $this, 'mock_success_without_sslverify' ), 10, 2 ); 74 75 wp_update_https_detection_errors(); 75 76 $this->assertSame( 76 array( 'ssl_verification_failed' => array( 'Bad SSL certificate.') ),77 array( 'ssl_verification_failed' => array( __( 'SSL verification failed.' ) ) ), 77 78 get_option( 'https_detection_errors' ) 78 79 ); 79 80 80 81 // If both initial request and request without SSL verification fail, 81 // return actual error from request.82 // return 'https_request_failed' error. 82 83 add_filter( 'pre_http_request', array( $this, 'mock_error_with_sslverify' ), 10, 2 ); 83 84 add_filter( 'pre_http_request', array( $this, 'mock_error_without_sslverify' ), 10, 2 ); 84 85 wp_update_https_detection_errors(); 85 86 $this->assertSame( 86 array( ' bad_ssl_certificate' => array( 'Bad SSL certificate.') ),87 array( 'https_request_failed' => array( __( 'HTTPS request failed.' ) ) ), 87 88 get_option( 'https_detection_errors' ) 88 89 );
Note: See TracChangeset
for help on using the changeset viewer.