Code Duplication    Length = 13-13 lines in 2 locations

projects/packages/connection/tests/php/test-rest-endpoints.php 2 locations

@@ 276-288 (lines=13) @@
273
	/**
274
	 * Testing the `connection/reconnect` endpoint, successful partial reconnect (blog token).
275
	 */
276
	public function test_connection_reconnect_partial_blog_token_success() {
277
		$this->setup_reconnect_test( 'blog_token' );
278
		add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10, 3 );
279
280
		$response = $this->server->dispatch( $this->build_reconnect_request() );
281
		$data     = $response->get_data();
282
283
		remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10 );
284
		$this->shutdown_reconnect_test( 'blog_token' );
285
286
		$this->assertEquals( 200, $response->get_status() );
287
		$this->assertEquals( 'completed', $data['status'] );
288
	}
289
290
	/**
291
	 * Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token).
@@ 293-305 (lines=13) @@
290
	/**
291
	 * Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token).
292
	 */
293
	public function test_connection_reconnect_partial_blog_token_fail() {
294
		$this->setup_reconnect_test( 'blog_token' );
295
		add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10, 3 );
296
297
		$response = $this->server->dispatch( $this->build_reconnect_request() );
298
		$data     = $response->get_data();
299
300
		remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10 );
301
		$this->shutdown_reconnect_test( 'blog_token' );
302
303
		$this->assertEquals( 500, $response->get_status() );
304
		$this->assertEquals( 'jetpack_secret', $data['code'] );
305
	}
306
307
	/**
308
	 * Testing the `connection/reconnect` endpoint, successful partial reconnect (user token).