|
@@ 179-191 (lines=13) @@
|
| 176 |
|
/** |
| 177 |
|
* Testing the `connection/reconnect` endpoint, successful partial reconnect (blog token). |
| 178 |
|
*/ |
| 179 |
|
public function test_connection_reconnect_partial_blog_token_success() { |
| 180 |
|
$this->setup_reconnect_test( 'blog_token' ); |
| 181 |
|
add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10, 3 ); |
| 182 |
|
|
| 183 |
|
$response = $this->server->dispatch( $this->build_reconnect_request() ); |
| 184 |
|
$this->assertEquals( 200, $response->get_status() ); |
| 185 |
|
|
| 186 |
|
$data = $response->get_data(); |
| 187 |
|
$this->assertEquals( 'completed', $data['status'] ); |
| 188 |
|
|
| 189 |
|
remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10 ); |
| 190 |
|
$this->shutdown_reconnect_test( 'blog_token' ); |
| 191 |
|
} |
| 192 |
|
|
| 193 |
|
/** |
| 194 |
|
* Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token). |
|
@@ 196-208 (lines=13) @@
|
| 193 |
|
/** |
| 194 |
|
* Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token). |
| 195 |
|
*/ |
| 196 |
|
public function test_connection_reconnect_partial_blog_token_fail() { |
| 197 |
|
$this->setup_reconnect_test( 'blog_token' ); |
| 198 |
|
add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10, 3 ); |
| 199 |
|
|
| 200 |
|
$response = $this->server->dispatch( $this->build_reconnect_request() ); |
| 201 |
|
$this->assertEquals( 500, $response->get_status() ); |
| 202 |
|
|
| 203 |
|
$data = $response->get_data(); |
| 204 |
|
$this->assertEquals( 'jetpack_secret', $data['code'] ); |
| 205 |
|
|
| 206 |
|
remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10 ); |
| 207 |
|
$this->shutdown_reconnect_test( 'blog_token' ); |
| 208 |
|
} |
| 209 |
|
|
| 210 |
|
/** |
| 211 |
|
* Testing the `connection/reconnect` endpoint, successful partial reconnect (user token). |