Changeset 50284 for trunk/tests/phpunit/tests/https-detection.php
- Timestamp:
- 02/10/2021 01:24:24 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/https-detection.php
r50075 r50284 66 66 add_filter( 'pre_http_request', array( $this, 'mock_success_with_sslverify' ), 10, 2 ); 67 67 wp_update_https_detection_errors(); 68 $this->assert Equals( array(), get_option( 'https_detection_errors' ) );68 $this->assertSame( array(), get_option( 'https_detection_errors' ) ); 69 69 70 70 // If initial request fails and request without SSL verification succeeds, … … 73 73 add_filter( 'pre_http_request', array( $this, 'mock_success_without_sslverify' ), 10, 2 ); 74 74 wp_update_https_detection_errors(); 75 $this->assert Equals(75 $this->assertSame( 76 76 array( 'ssl_verification_failed' => array( 'Bad SSL certificate.' ) ), 77 77 get_option( 'https_detection_errors' ) … … 83 83 add_filter( 'pre_http_request', array( $this, 'mock_error_without_sslverify' ), 10, 2 ); 84 84 wp_update_https_detection_errors(); 85 $this->assert Equals(85 $this->assertSame( 86 86 array( 'bad_ssl_certificate' => array( 'Bad SSL certificate.' ) ), 87 87 get_option( 'https_detection_errors' ) … … 92 92 add_filter( 'pre_http_request', array( $this, 'mock_not_found' ), 10, 2 ); 93 93 wp_update_https_detection_errors(); 94 $this->assert Equals(94 $this->assertSame( 95 95 array( 'bad_response_code' => array( 'Not Found' ) ), 96 96 get_option( 'https_detection_errors' ) … … 101 101 add_filter( 'pre_http_request', array( $this, 'mock_bad_source' ), 10, 2 ); 102 102 wp_update_https_detection_errors(); 103 $this->assert Equals(103 $this->assertSame( 104 104 array( 'bad_response_source' => array( 'It looks like the response did not come from this site.' ) ), 105 105 get_option( 'https_detection_errors' ) … … 107 107 108 108 // Check that the requests are made to the correct URL. 109 $this->assert Equals( 'https://example.com/', $this->last_request_url );109 $this->assertSame( 'https://example.com/', $this->last_request_url ); 110 110 } 111 111 … … 122 122 ); 123 123 wp_update_https_detection_errors(); 124 $this->assert Equals( array(), get_option( 'https_detection_errors' ) );124 $this->assertSame( array(), get_option( 'https_detection_errors' ) ); 125 125 126 126 // Override to enforce an error being detected. … … 135 135 ); 136 136 wp_update_https_detection_errors(); 137 $this->assert Equals(137 $this->assertSame( 138 138 array( 'ssl_verification_failed' => array( 'Bad SSL certificate.' ) ), 139 139 get_option( 'https_detection_errors' ) … … 146 146 public function test_wp_schedule_https_detection() { 147 147 wp_schedule_https_detection(); 148 $this->assert Equals( 'twicedaily', wp_get_schedule( 'wp_https_detection' ) );148 $this->assertSame( 'twicedaily', wp_get_schedule( 'wp_https_detection' ) ); 149 149 } 150 150 … … 158 158 'args' => array( 'sslverify' => true ), 159 159 ); 160 $this->assert Equals( $request, wp_cron_conditionally_prevent_sslverify( $request ) );160 $this->assertSame( $request, wp_cron_conditionally_prevent_sslverify( $request ) ); 161 161 162 162 // If URL is using HTTPS, set 'sslverify' to false. … … 167 167 $expected = $request; 168 168 $expected['args']['sslverify'] = false; 169 $this->assert Equals( $expected, wp_cron_conditionally_prevent_sslverify( $request ) );169 $this->assertSame( $expected, wp_cron_conditionally_prevent_sslverify( $request ) ); 170 170 } 171 171
Note: See TracChangeset
for help on using the changeset viewer.