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