Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 226-238 (lines=13) @@
223
	/**
224
	 * Testing the `connection/reconnect` endpoint, successful partial reconnect (blog token).
225
	 */
226
	public function test_connection_reconnect_partial_blog_token_success() {
227
		$this->setup_reconnect_test( 'blog_token' );
228
		add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10, 3 );
229
230
		$response = $this->server->dispatch( $this->build_reconnect_request() );
231
		$data     = $response->get_data();
232
233
		remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request' ), 10 );
234
		$this->shutdown_reconnect_test( 'blog_token' );
235
236
		$this->assertEquals( 200, $response->get_status() );
237
		$this->assertEquals( 'completed', $data['status'] );
238
	}
239
240
	/**
241
	 * Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token).
@@ 243-255 (lines=13) @@
240
	/**
241
	 * Testing the `connection/reconnect` endpoint, failed partial reconnect (blog token).
242
	 */
243
	public function test_connection_reconnect_partial_blog_token_fail() {
244
		$this->setup_reconnect_test( 'blog_token' );
245
		add_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10, 3 );
246
247
		$response = $this->server->dispatch( $this->build_reconnect_request() );
248
		$data     = $response->get_data();
249
250
		remove_filter( 'pre_http_request', array( $this, 'intercept_refresh_blog_token_request_fail' ), 10 );
251
		$this->shutdown_reconnect_test( 'blog_token' );
252
253
		$this->assertEquals( 500, $response->get_status() );
254
		$this->assertEquals( 'jetpack_secret', $data['code'] );
255
	}
256
257
	/**
258
	 * Testing the `connection/reconnect` endpoint, successful partial reconnect (user token).