|
@@ 249-261 (lines=13) @@
|
| 246 |
|
/** |
| 247 |
|
* Testing the `connection/reconnect` endpoint, successful partial reconnect (blog token). |
| 248 |
|
*/ |
| 249 |
|
public function test_connection_reconnect_partial_blog_token_success() { |
| 250 |
|
$this->setup_reconnect_test( 'blog_token' ); |
| 251 |
|
add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10, 3 ); |
| 252 |
|
|
| 253 |
|
$response = $this->server->dispatch( $this->build_reconnect_request() ); |
| 254 |
|
$data = $response->get_data(); |
| 255 |
|
|
| 256 |
|
remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10 ); |
| 257 |
|
$this->shutdown_reconnect_test( 'blog_token' ); |
| 258 |
|
|
| 259 |
|
$this->assertEquals( 200, $response->get_status() ); |
| 260 |
|
$this->assertEquals( 'completed', $data['status'] ); |
| 261 |
|
} |
| 262 |
|
|
| 263 |
|
/** |
| 264 |
|
* Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token). |
|
@@ 266-278 (lines=13) @@
|
| 263 |
|
/** |
| 264 |
|
* Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token). |
| 265 |
|
*/ |
| 266 |
|
public function test_connection_reconnect_partial_blog_token_fail() { |
| 267 |
|
$this->setup_reconnect_test( 'blog_token' ); |
| 268 |
|
add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10, 3 ); |
| 269 |
|
|
| 270 |
|
$response = $this->server->dispatch( $this->build_reconnect_request() ); |
| 271 |
|
$data = $response->get_data(); |
| 272 |
|
|
| 273 |
|
remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10 ); |
| 274 |
|
$this->shutdown_reconnect_test( 'blog_token' ); |
| 275 |
|
|
| 276 |
|
$this->assertEquals( 500, $response->get_status() ); |
| 277 |
|
$this->assertEquals( 'jetpack_secret', $data['code'] ); |
| 278 |
|
} |
| 279 |
|
|
| 280 |
|
/** |
| 281 |
|
* Testing the `connection/reconnect` endpoint, successful partial reconnect (user token). |